microcule
microcule copied to clipboard
Better `babel` support / support for `.babelrc` file
Our current configuration of babel for microservices is a bit hard-coded. We should respect the users .babelrc configuration / make babel configurable in the stack tool.
see: https://github.com/Stackvana/stack/blob/master/lib/compileServiceCode/babel/index.js#L7
I'm not personally using babel for development, so it any babel users can assist here, it would be much appreciated.
cc @ljharb
You'll need to get their babel settings, but also the node modules that they depend on (ie, babel plugins and presets)
@ljharb -
Is there a module which will do this already?
Will the users have to modify package.json dependencies based on their config? Is this automated anywhere?
Trying to get a feel so that this will "just work" for babel users.
Essentially, we need to be able to clone this folder and run npm start https://github.com/Stackvana/microservice-examples/tree/master/babel-hello-world Current issue is that plugins and presets don't know where to resolve.
When running babel-hello-world as standalone.
ReferenceError: Unknown plugin "syntax-async-functions" specified in "base" at 0, attempted to resolve relative to "/Users/a/dev/stackvana/microservice-examples/babel-hello-world"
at /Users/a/dev/stackvana/stack/node_modules/babel-core/lib/transformation/file/options/option-manager.js:177:17
at Array.map (native)
at Function.normalisePlugins (/Users/a/dev/stackvana/stack/node_modules/babel-core/lib/transformation/file/options/option-manager.js:153:20)
at OptionManager.mergeOptions (/Users/a/dev/stackvana/stack/node_modules/babel-core/lib/transformation/file/options/option-manager.js:245:36)
at OptionManager.init (/Users/a/dev/stackvana/stack/node_modules/babel-core/lib/transformation/file/options/option-manager.js:383:12)
at File.initOptions (/Users/a/dev/stackvana/stack/node_modules/babel-core/lib/transformation/file/index.js:223:65)
at new File (/Users/a/dev/stackvana/stack/node_modules/babel-core/lib/transformation/file/index.js:140:24)
at Pipeline.transform (/Users/a/dev/stackvana/stack/node_modules/babel-core/lib/transformation/pipeline.js:46:16)
at Object.compileBabel [as babel] (/Users/a/dev/stackvana/stack/lib/compileServiceCode/babel/index.js:24:16)
at _spawnService (/Users/a/dev/stackvana/stack/lib/spawn.js:186:58)
they need to be installed locally inside the project that references them, i think
That makes sense.
I guess best practice is for developers to specify the required deps in dev dependencies of the project.