GithubHelp home page GithubHelp logo

borisovg / metalsmith-uglify Goto Github PK

View Code? Open in Web Editor NEW
22.0 22.0 4.0 245 KB

UglifyJS plugin for Metalsmith

License: GNU Lesser General Public License v3.0

JavaScript 88.93% Makefile 8.09% CSS 1.33% Pug 1.65%

metalsmith-uglify's People

Contributors

altano avatar borisovg avatar dependabot[bot] avatar ksmithut avatar zommerfelds avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

metalsmith-uglify's Issues

Does not work on Windows

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.

Plugin fails when there are no JS files

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.

allow filter parameter to pass an array with globbing

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

workaround to replace old "sourceMap" configuration parameter

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 ?

problems using filter option

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

Concatenation and source maps

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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.