gordon icon indicating copy to clipboard operation
gordon copied to clipboard

when using babel for es6, what's the recommended way to get node_modules into _build?

Open tombray opened this issue 8 years ago • 2 comments

In the simple es6 example, the settings.yml

build: TARGET={target} npm run build

and the build script is as follows:

"build": "babel *.js --out-dir $TARGET"

This doesn't take into account node_modules. I've added some additional dependencies that I need to be included in node_modules in the _build directory. What's the recommended approach to do this?

Thanks!

tombray avatar Jun 30 '16 05:06 tombray

And actually, since Node 4.3.2 supports es6, the babel transpilation shouldn't be necessary. I tried removing the custom npm run build, but gordon build just hangs.

tombray avatar Jun 30 '16 17:06 tombray

I ran into this problem and solved it with this hack babel code.js lib/*.js --out-dir $TARGET && cp -a node_modules $TARGET

It feels a bit dirty though.. Since it copies the node_modules/.bin/ folder and also all devDependencies.

peralmq avatar Mar 30 '17 14:03 peralmq