borisovg / metalsmith-uglify Goto Github PK
View Code? Open in Web Editor NEWUglifyJS plugin for Metalsmith
License: GNU Lesser General Public License v3.0
UglifyJS plugin for Metalsmith
License: GNU Lesser General Public License v3.0
Hello,
I noticed this plugin does not work on windows.
Acording to debug log it does not log any input JS files.
I suspect it is because of backslash in windows paths as functions in plugin are parsing path according to slash.
Error: uglify: Failed to minify : TypeError: Cannot read property 'figure_out_scope' of null
This will happen when you're setting up a project to be able to handle JS files in the future but there are none yet. Workaround is to make a blank file, but I'd rather not have to do that.
The concat
option does not allow to pass an array. In my case, I would like to be able to have the following configuration :
filter: ['js/jquery-2.1.1.min.js', 'js/bootstrap/*.js', 'js/**/*.js']
and I get the following error :
Error: uglify: Failed to minify : TypeError: Cannot read property 'figure_out_scope' of null
Is there a workaround to replace the old sourceMap
configuration parameter :
.use(uglify({ // minify and concat javascript
concat: 'js/app.min.js',
sourceMap: true
}))
I'm thinking about something like another metalsmith plugin to achieve this task ? Or is it best located in metalsmith-ulgify module, when you'll have time to re-add this feature ?
I noticed you rename the output file rather than update the file in-place. Can this be optional?
https://github.com/ksmithut/metalsmith-uglify/blob/master/lib/normalize-options.js#L106
I am passing filter as an option; yet seems to be ignored:
.use(uglify({
filter: ['./lib/lodash/dist/lodash.js']
}))
Can I also process files outside the src folder? This is my structure:
-/lib
-/src
--/posts
-/build.js
There has been development on a new fork of uglify-es, which is now called terser and has its own package!
"terser": "^3.7.3"
Please upgrade to our new version.
Hey all,
I've recently started using metalsmith-uglify for a project and am running into the source maps issue happening when concatenating multiple files. Seems as if the sourcemaps generated by Uglify only refers to the very first file passed through concatenation even when the error is in other files. The line number is correct however.
I've seen this problem be mentioned in various places in the project and issues. I am just wondering today whether someone has come up with solution or alternative?
Thank you very much
Would it be possible to have an option to remove the originals from the file
object once those files were minified?
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.