Comments (10)
Yep! The only thing that globify does is expand glob patterns. All other parameters get passed straight to Browserify or Watchify. So you can specify any plugins, transforms, or options you want, including uglifyify.
globify "lib/**/*-entry-file.js" -t uglifyify --debug
from globify.
btw... you might also want to check out simplifyify, which is another one of my projects. It simplifies the Browserify CLI for most common use-cases, such as code-minification, source maps, and code-coverage instrumentation.
from globify.
I meant minifyify because some commands require the name of the files to be passed. Do you recommend one over the other?
from globify.
Ah I remember simplify now, I opened JS-DevTools/simplifyify#6 a while back.
from globify.
Yeah, minifyify is tricky, because it needs you to pass the name of a single file as an argument, which makes it not work well with glob patterns at all. I wonder if minifyify has an option to auto-generate the sourcemap file name? If so, then that would probably work for you
from globify.
When using
globify 'dist/js/*.coffee' -t uglifyify --outfile 'dist/js/*.js'
I get this error:
Error
at new JS_Parse_Error (<anonymous>:1526:18)
at js_error (<anonymous>:1534:11)
at croak (<anonymous>:2026:9)
at token_error (<anonymous>:2034:9)
at unexpected (<anonymous>:2040:9)
at semicolon (<anonymous>:2060:56)
at simple_statement (<anonymous>:2240:73)
at eval (<anonymous>:2113:19)
at eval (<anonymous>:2073:24)
at eval (<anonymous>:2827:23)
at Object.parse (<anonymous>:2837:7)
at /Users/user/Work/extension/chrome-extension/node_modules/uglifyify/node_modules/uglify-js/tools/node.js:64:33
at Array.forEach (native)
at Object.exports.minify (/Users/user/Work/extension/chrome-extension/node_modules/uglifyify/node_modules/uglify-js/tools/node.js:59:15)
at Stream.ready (/Users/user/Work/extension/chrome-extension/node_modules/uglifyify/index.js:70:19)
at Stream.<anonymous> (/Users/user/Work/extension/chrome-extension/node_modules/uglifyify/index.js:96:12)
at _end (/Users/user/Work/extension/chrome-extension/node_modules/through/index.js:65:9)
at Stream.stream.end (/Users/user/Work/extension/chrome-extension/node_modules/through/index.js:74:5)
at DestroyableTransform.onend (/Users/user/Work/extension/chrome-extension/node_modules/through2/node_modules/readable-stream/lib/_stream_readable.js:545:10)
at DestroyableTransform.g (events.js:260:16)
at emitNone (events.js:72:20)
at DestroyableTransform.emit (events.js:166:7)
at endReadableNT (/Users/user/Work/extension/chrome-extension/node_modules/through2/node_modules/readable-stream/lib/_stream_readable.js:960:12)
at nextTickCallbackWith2Args (node.js:474:9)
at process._tickCallback (node.js:388:17)
from globify.
Don't forget to add the coffeescript transform
from globify.
Its in the global transforms.
from globify.
kk. well try using the raw Browserify command first, to make sure everything's correct. then replace browserify with globify. the error you're getting is from uglifyify, not globify
from globify.
Thanks, it was something with the global transforms, because I'm importing some coffee files as modules.
Now somthing else. From the Ugligyfyify docs:
"Uglifyify provides an additional optimization when used with Uglify, but does not provide all of the optimization that using Uglify on its own does, so it's not a replacement."
And indeed the bundle size resulting from uglifyify is bigger than the one produced by normal Uglifyjs2.
Is it possible to apply normal uglify with globify?
from globify.
Related Issues (12)
- it doesn't support multiple paths HOT 1
- Unnecessary console.log HOT 5
- Excellent useful and helpful project HOT 1
- Using the programmatic API of browserify HOT 3
- Watch subclasses build main classes HOT 7
- Parse arbritary glob parameters HOT 1
- Output to file next to input file HOT 2
- Exclude from glob HOT 5
- Options -v -d HOT 7
- Uglifyjs support HOT 1
- Support watchify pipe output option HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from globify.