Base solution for your next web application
Open Closed

VS2022 - WebCompiler and BundlerMinifier #10802


User avatar
0
deltavision created

Hi,

Version: 9.0.1, ASP NET CORE, MVC

With reference to #7666

Started using VS2022.

  • and the "old" Web Compiler from Mads Kristensen (less -> css) is no longer supported. https://marketplace.visualstudio.com/items?itemName=MadsKristensen.WebCompiler

But is continued by Jason Moore at: https://marketplace.visualstudio.com/items?itemName=Failwyn.WebCompiler64&ssr=false#overview

Is that also what you are using / recommend?

Regarding Bundler & Minifier - is that used anymore? https://marketplace.visualstudio.com/items?itemName=MadsKristensen.BundlerMinifier

Is that not handled by "gulp" ?


6 Answer(s)
  • User Avatar
    0
    ismcagdas created
    Support Team

    Hi @deltavision

    You don't need to use WebCompiler and BundlerMinifier. As you stated, gulp task handles less to css converstion. But, if you need to use those extensions for other purposes, I tried them with VS 2022 and worked for me in 2-3 weeks ago.

  • User Avatar
    0
    deltavision created

    Hi @ismcagdas,

    I can not see that gulp transforms any new less files to css. Do I have to set something up on new files (less) ?

    Any changes to the build scripts?

    For Development (create-bundles)

    set projectDir= [....path...]
    
    set workingDir=C:\Program Files\Microsoft Visual Studio\2022\Professional\Common7\Tools\
    set vs=VsDevCmd.bat
    
    cd %workingDir%
    start /b %vs%
    
    :: your commands go here, such as:
    d:
    cd %projectDir%
    npm run create-bundles
    
    

    For Production (build)

    set projectDir=[....path...]
    
    set workingDir=C:\Program Files\Microsoft Visual Studio\2022\Professional\Common7\Tools\
    set vs=VsDevCmd.bat
    
    cd %workingDir%
    start /b %vs%
    
    :: your commands go here, such as:
    d:
    cd %projectDir%
    npm run build
    
    
  • User Avatar
    0
    ismcagdas created
    Support Team

    Hi,

    Yes, you need to add new style files to bundles.json file.

  • User Avatar
    0
    deltavision created

    Hi,

    how do we indicate that in bundles.json? - just change the file extensions from css to less or how?

  • User Avatar
    0
    musa.demir created

    Hi @deltavision

    It already has less files input. See: https://github.com/aspnetzero/aspnet-zero-core/blob/59d8a2e46e84f4a67b4ce369cf604847863bc107/aspnet-core/src/MyCompanyName.AbpZeroTemplate.Web.Mvc/bundles.json#L512-L524

  • User Avatar
    0
    deltavision created

    Hi,

    OK - I see :-)