Closed mattnibs closed 8 years ago
@rlgomes @demmer (if @go-oleg is still around)
@mnibecker, thanks...definitely need to have build artifacts that can be included in the browser or required.
Some thoughts/questions:
ext
convention anywhere...can you point me to a js lib that uses that? If you are trying to prevent .gitignore
from ignoring a nested lib
folder, you can add /lib
in the .gitignore
instead of lib
. As far as having a lib
folder under src
, I'm not sure why thats bad. We could move the folders in there to be directly in src
or organize them in some other way.babelify
and gulp-babel
goes, I think if you have browserify
work on the output of your lib
task, then it no longer needs babelify
, so you could get rid of that dependency there.index.js
in lib
and not in src
?src
package.json
in a browserify
property which tells browserify what transforms need to be applied. This is super convenient for consumers of this lib that use browserify to build their applications because they can browserify the whole thing without having to worry about what transforms need to be applied to this specific library. Perhaps adding this to the package.json
would be a good idea. I tried to find something similar for webpack but couldn't...do you know if it exists?Thanks for your feedback @go-oleg.
.gitignore
thing and 2) with the lib output you would have a folder called lib/lib
which I thought was kind of weird. Honestly I think the best solution would be to just flatten the whole thing. I think for right now I'll just keep it lib
and we can discuss this at a later date.gulp-babel
to rewrite the entire contents of lib, then for browserify
to kick off and write its output. Seemed like a lot. I would prefer to ditch gulp altogether and go with webpack which would do this all in memory and be a lot faster and less weird.webpack --config webpack.config.js
?@go-oleg I got rid of the whole ext
business.
snds good!
With our current setup we were running into a couple issues when importing juttle-viz into other libraries. 1) We couldn't import and browserify the library because we weren't babelify the source and 2) We weren't generating a javascript blob that I can throw into my browser.
What I did here:
gulp lib
task that run all js code through babel and spits it out into a lib dir. As such I've pointed the entry to lib/index.js. Now requiring juttle-viz should "Just Work"(TM).gulp clean
command that removes generated dirs (lib, build and test/build)Moving forward: Kind of weird that babel has two different libraries: gulp-babel and gulp-babelify. Ideally we create the artifact and lib using the same babel lib. In a future pr we might want to use webpack while might give us the flexibility that we need.