Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Better babel support / support for .babelrc file #7

Open
Marak opened this issue Sep 30, 2016 · 5 comments
Open

Better babel support / support for .babelrc file #7

Marak opened this issue Sep 30, 2016 · 5 comments

Comments

@Marak
Copy link
Collaborator

Marak commented Sep 30, 2016

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

@ljharb
Copy link
Collaborator

ljharb commented Sep 30, 2016

You'll need to get their babel settings, but also the node modules that they depend on (ie, babel plugins and presets)

@Marak
Copy link
Collaborator Author

Marak commented Sep 30, 2016

@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.

@Marak
Copy link
Collaborator Author

Marak commented Sep 30, 2016

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)

@ljharb
Copy link
Collaborator

ljharb commented Sep 30, 2016

they need to be installed locally inside the project that references them, i think

@Marak
Copy link
Collaborator Author

Marak commented Sep 30, 2016

That makes sense.

I guess best practice is for developers to specify the required deps in dev dependencies of the project.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants