WebCompiler
WebCompiler copied to clipboard
.min.js instead of .es5.js
Installed product versions
- Visual Studio: 2022
- This extension: 1.14.11
Description
When I compile .js files, they automatically compile to a .es5.js and .es5.js.gz file. Is there a setting to make them compile automatically to a .min.js and .min.js.gz file? Right now I have to compile it as .es5.js and then change the compiilerconfig.json file to have .min instead of .es5.
Can you post your compiler json file?
[ { "outputFile": "wwwroot/js/slider.min.js", "inputFile": "wwwroot/js/slider.js" } ]
When I first compile the js file it's like the following
[ { "outputFile": "wwwroot/js/slider.es5.js", "inputFile": "wwwroot/js/slider.js" } ]
Below is the .defaults file { "compilers": { "less": { "autoPrefix": "", "cssComb": "none", "ieCompat": true, "math": null, "strictMath": false, "strictUnits": false, "relativeUrls": true, "rootPath": "", "sourceMapRoot": "", "sourceMapBasePath": "", "sourceMap": false }, "sass": { "autoPrefix": "", "loadPaths": "", "style": "expanded", "relativeUrls": true, "sourceMap": false }, "nodesass": { "autoPrefix": "", "includePath": "", "indentType": "space", "indentWidth": 2, "outputStyle": "nested", "precision": 5, "relativeUrls": true, "sourceMapRoot": "", "lineFeed": "", "sourceMap": false }, "stylus": { "sourceMap": false }, "babel": { "sourceMap": false }, "coffeescript": { "bare": false, "runtimeMode": "node", "sourceMap": false }, "handlebars": { "root": "", "noBOM": false, "name": "", "namespace": "", "knownHelpersOnly": false, "forcePartial": false, "knownHelpers": [], "commonjs": "", "amd": false, "sourceMap": false } }, "minifiers": { "css": { "enabled": true, "termSemicolons": true, "gzip": false }, "javascript": { "enabled": true, "termSemicolons": true, "gzip": true } }, "formats": [ "es6;", { "extensions": [ ".es6.js" ], "compiler": { "name": "babel", "output": ".js" }, "minifier": { "name": "javascript", "output": ".min.js", "map": ".js.map" } }, "es5;", { "extensions": [ ".js" ], "compiler": null, "minifier": { "name": "javascript", "output": ".min.js", "map": ".js.map" } }, "js;", { "extensions": [ ".js" ], "compiler": null, "minifier": { "name": "javascript", "output": ".min.js", "map": ".js.map" } }, "sass;", { "extensions": [ ".scss", ".sass" ], "compiler": { "name": "sass", "output": ".css" }, "minifier": { "name": "css", "output": ".min.css", "map": ".css.map" } }, "css;", { "extensions": [ ".css" ], "compiler": null, "minifier": { "name": "css", "output": ".min.css", "map": ".css.map" } } ] }
I’ll take a look at this tomorrow, I’ve never used any of the es5 or es6 functionality. As a workaround, you could try disabling minification in the compiler config and use the BundlerMinifier VSIX to minify the files.