1

I have an ASP.NET MVC 5 project created in Visual Studio 2017 which uses Vue.js and ES6.

Is there a way to transpile and minify javascript files without using npm and maybe using some Visual Studio extensions and/or some nuget package(s)?

All solutions that I found use gulp with brawserify or webpack and I don't want to use any of those tools.

1 Answer 1

1

Edit: The below only works for minification of bundles. I missed the requirement of transpiling the *.vue files.

In BundleConfig.cs add System.Web.Optimization.BundleTable.EnableOptimizations = true; bool BundleTable.EnableOptimizations {get; set;}"Gets or sets whether bundling and minification of bundle reference is enabled."

public static void RegisterBundles(BundleCollection bundles)
{ 
    bundles.Add(new ScriptBundle("~/bundlesjquery").Include(
       "~/Scripts/jquery-{version}.js",
       "~/Scripts.jquery.validate*"));

    System.Web.Optimization.BundleTable.EnableOptimizations = true;
}
Sign up to request clarification or add additional context in comments.

1 Comment

The problem is that I use .vue templates and es6 modules, files which need to be first transpiled and then minified

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.