WebReflection Ltd
webreflection / ucompress Goto Github PK
View Code? Open in Web Editor NEWA micro, all-in-one, compressor for common Web files.
License: ISC License
A micro, all-in-one, compressor for common Web files.
License: ISC License
The --no-mifiy
flag works great, but when the code is minified, it would be awesome to have at least JavaScript files with a source map, so that debugging would become much easier.
Add a --source-map
flag and save one in the destination folder without bothering with compression and the rest (at least as first implementation).
Hi, @WebReflection!
How to use this?
Thanks for this project !
I am doing a tool that build some files into a build folder and expose a import-map.json that is used to tell the browser to match some imports in the source code to the built files. See here for more information: https://github.com/nestarz/esdev
The thing is I can't use your tool with it because it doesn't use import maps like the browser do to resolve imports.
Do you think it can be added easily ? Or if there is a workaround to it ?
If you globally install ucompress
, then you cannot require it, at least with git bash on Windows.
This is a nuance for any global package, not only ucompress
.
To fix it : export NODE_PATH=$APPDATA/npm/node_modules
$ npm i -g ucompress
[cut]
+ [email protected]
updated 1 package in 19.948s
$ node
Welcome to Node.js v12.16.3.
Type ".help" for more information.
> const ucompress = require('ucompress');
Uncaught Error: Cannot find module 'ucompress'
Require stack:
- <repl>
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:957:15)
at Function.Module._load (internal/modules/cjs/loader.js:840:27)
at Module.require (internal/modules/cjs/loader.js:1019:19)
at require (internal/modules/cjs/helpers.js:77:18) {
code: 'MODULE_NOT_FOUND',
requireStack: [ '<repl>' ]
}
>
(To exit, press ^C again or ^D or type .exit)
>
$ npm ls -g ucompress
C:\Users\[cut]\AppData\Roaming\npm
`-- [email protected]
$ export NODE_PATH=$APPDATA/npm/node_modules
$ node
Welcome to Node.js v12.16.3.
Type ".help" for more information.
> const ucompress = require('ucompress');
undefined
>
Just a reminder for casual developer as me, when you read README section As binary file
, you use the command line and then you want using the dep for a quick snippet.
It'd be great to combine HTML literals minification within terser, but so far I couldn't find a way to combine both approaches into one (due source map).
Any hint/help appreciated.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.