Dab tsi yog bundling thiab minification hauv ASP NET MVC?
Dab tsi yog bundling thiab minification hauv ASP NET MVC?

Video: Dab tsi yog bundling thiab minification hauv ASP NET MVC?

Video: Dab tsi yog bundling thiab minification hauv ASP NET MVC?
Video: Yog ntuj tsis pab ntshe kuv tuag lawm 8/6/2018 2024, Hlis ntuj nqeg
Anonim

Ob leeg bundling thiab minification yog ob txoj kev sib cais los txo lub sijhawm thauj khoom. Cov pob txo tus naj npawb ntawm kev thov rau Server, thaum lub kev ua kom tsawg txo qhov loj ntawm cov khoom muaj nqis thov.

Tom qab ntawd, dab tsi yog bundling thiab minification hauv MVC?

MVC siv cov txheej txheem hu ua kev ua kom tsawg ntawm ua ke cov ntaub ntawv. Bundling thiab Minification muab ib txoj hauv kev rau ob qho tib si txo tus naj npawb ntawm kev thov xav tau kom tau txais cov ntaub ntawv JS thiab CSS thiab txo qhov loj ntawm cov ntaub ntawv lawv tus kheej, yog li txhim kho cov lus teb ntawm peb cov apps.

Ib yam li ntawd, BundleConfig Cs yog dab tsi hauv ASP NET MVC? BundleConfig yog tsis muaj dab tsi ntau tshaj li bundle configuration tsiv mus rau cais cov ntaub ntawv. Nws siv los ua ib feem ntawm app startup code (filters, pob , txoj kev siv los teeb tsa hauv ib chav kawm) Txhawm rau ntxiv cov ntaub ntawv no, ua ntej koj yuav tsum ntxiv Microsoft. AspNet . Web. Optimization nuget pob rau koj qhov project web: Install-Package Microsoft.

Tsuas yog li ntawd, dab tsi yog bundling thiab minification?

Bundling thiab minification yog ob txoj hauv kev uas koj tuaj yeem siv hauv ASP. NET 4.5 txhawm rau txhim kho kev thov lub sijhawm thauj khoom. Bundling thiab minification txhim kho lub sijhawm thauj khoom los ntawm kev txo tus naj npawb ntawm kev thov rau lub server thiab txo qhov loj ntawm cov khoom thov (xws li CSS thiab JavaScript.)

Yuav ua li cas Minification yog siv nyob rau hauv MVC?

Bundling thiab kev ua kom tsawg tuaj yeem qhib lossis ua tsis taus nyob rau hauv ob txoj hauv kev: ob qho tib si teeb tsa tus nqi ntawm tus cwj pwm kev debug hauv qhov muab tso ua ke Element hauv Web. config cov ntaub ntawv lossis teeb tsa cov cuab yeej enableOptimizations ntawm BundleTable chav kawm. Hauv qhov piv txwv hauv qab no, debug yog teem rau muaj tseeb hauv web.

Pom zoo: