![]() UglifyJS 3: Online JavaScript minifier is a useful way to try out Ugllify since it shows you the results as you type, which makes it easy to spot tiny changes you can make that result in a shorter minified output. You can use tercer instead: npx terser codemirror-5.57.0.js -o codemirror-5.57.0.min.js -comments '/LICENSE/'ĭiscovered in datasette-edit-tables #16. It turns out uglify-js doesn't support ES6 at all. */ comment at the top of the file (instead of multiple // lines) and ran Uglify like this: npx uglify-js codemirror-5.57.0.js -o codemirror-5.57.0.min.js -comments '/LICENSE/'įor CSS I used clean-css-cli: npx clean-css-cli codemirror-5.57.0.css -o codemirror-5.57.0.min.css So I edited the CodeMirror file to use a single /*. minify-ts 1.0. Turns out you can tell uglify-js not to strip comments that match a specific regular expression. One problem: this stripped out the LICENSE comment at the top of the file. Start using gulp-typescript in your project by running npm i gulp-typescript. Latest version: 6.0.0-alpha.1, last published: 3 years ago. We simply use the following syntax: Syntax: tsc out outputFile.js typeScriptFile1.ts typeScriptFile2.ts typeScriptFilen.ts Explanation: tsc: It stands for TypeScript compiler which is used to invoke the compiler in order to compile the TypeScript files. ![]() While upgrading CodeMirror in Datasette I figured out how to minify JavaScript using uglify-js on the command line without first installing any teels, using npx (which downloads and executes a CLI tool while skipping the install step): npx uglify-js codemirror-5.57.0.js -o codemirror-5.57.0.min.js A typescript compiler for gulp with incremental compilation support. Approach 1: Compiling multiple Typescript files into a single JavaScript file. Simon Willison’s TILs Minifying JavaScript with npx uglify-js Minifying JavaScript with npx uglify-js | Simon Willison’s TILs
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |