js-devtools / globify Goto Github PK
View Code? Open in Web Editor NEWRun browserify and watchify with globs - even on Windows!
Home Page: https://jstools.dev/globify/
License: MIT License
Run browserify and watchify with globs - even on Windows!
Home Page: https://jstools.dev/globify/
License: MIT License
The watchify docs say:
--outfile=FILE, -o FILE
This option is required. Write the browserify bundle to this file. If
the file contains the operators `|` or `>`, it will be treated as a
shell command, and the output will be piped to it.
Problem is that if you provide the outputfile something like the examples given
-o 'exorcist static/bundle.js.map > static/bundle.js'
globify does not recognise it as such and creates a folder instead.
The idea is to find all the *
inside a string and replace the *
with the file name like it is done for the --outfile
paramenter.
This is what I'm trying to do:
globify -t coffeeify 'coffee/*.coffee' --debug -p [minifyify --map 'js/*.map.json' --output 'js/*.map.json'] --outfile 'js/*.js'
But results in this:
browserify -t coffeeify coffee/content-gist.coffee --debug -p [minifyify --map js/*.map.json --output js/*.map.json] --outfile js/content-gist.js
browserify -t coffeeify coffee/content-import.coffee --debug -p [minifyify --map js/*.map.json --output js/*.map.json] --outfile js/content-import.js
browserify -t coffeeify coffee/eventPage.coffee --debug -p [minifyify --map js/*.map.json --output js/*.map.json] --outfile js/eventPage.js
browserify -t coffeeify coffee/options.coffee --debug -p [minifyify --map js/*.map.json --output js/*.map.json] --outfile js/options.js
browserify -t coffeeify coffee/test.coffee --debug -p [minifyify --map js/*.map.json --output js/*.map.json] --outfile js/test.js
If you have any other suggestions on how to achieve multiple file uglify with working coffeescript source maps please advise.
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?
Related to #3
It doesn't support multiple paths such as this:
globify path1*.js path2*.js -o output.js
I'm trying to find all .coffee
files in my directory tree and have globify output .js
files next to them. Is this possible without having a single directory as a destination?
Is there a way to exclude certain patterns, like for example the node_modules directory?
Maybe something in the lines of what bash supports? **/*.coffee!(*node_modules*)
These options appear in the a REAME example but doesn't seem to be any more information about them.
https://github.com/BigstickCarpet/globify/blob/master/lib/index.js#L49
Why is this here? It makes outputting to stdout instead of using --outfile useless because stdout contains a command before the browserify output.
No issue here, I just wanted to praise you for creating globify!
Been fighting using globs with npm scripts, browserify, and Windows. This project was the saving grace I've been trying to find for over 2 weeks.
While piping would be nice (so I can only use globify and not need to install watchify and browserify), I just wanted to thank you for the project and maintaining it!
Is there a way to use globify together with uglifyify?
Is there any reason you don't use the programmatic API of browserify/watchify
Spawning a new process for every entry point seems slow to me.
Would you accept a PR that would leverage the programmatic API of the tools?
Couldn't think of better title...
Here is an example of project structure:
lib/
|__ cars.js
|__ animals.js
|__ classes/
|__ dog.js
|__ cat.js
|__ volvo.js
|__ porshe.js
currently it is only possible to watch main files and compile corresponding files...
e.g. if globify 'lib/*.js' -w -v -o 'lib/out'
it will compile only when cars.js or animals.js is changed
is there any way to watch for all js in lib and compile cars.js and animals.js
or at least watch for all and compile all files?
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.