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

Allow for webpack resolve configs to be passed directly #908

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

eloytoro
Copy link
Contributor

Right now term supports passing the configPath and the modules options to the webpack plugin.

As it so happens, webpack 2 natively supports configs to be written using ES6 modules because it transpiles the config using babel if it has the .babel.js termination.

There are two ways to solve this as far as I can see.

  • Add babel-core as a dependency to tern
  • Allow to pass the values directly to the config

The first solution is the best one for users in my opinion, being able to require their babel-esque config would silently fix the issue. If you guys like it we can close this PR and I can open another one that takes care of this.

The second solution is what I'm doing here, allowing to pass "alias" to the config should fix the issue for now

@eloytoro
Copy link
Contributor Author

Note: allowing to compile the config using babel-register adds a noticeable delay to server startup

@tyrocca
Copy link

tyrocca commented Jun 5, 2017

Until this is merged, is there a good workaround?

@eloytoro
Copy link
Contributor Author

eloytoro commented Jun 5, 2017

@tyrocca the only work around would be to not use babel for the webpack config so it can be required directly as a node module

@chemzqm
Copy link
Contributor

chemzqm commented Jun 14, 2017

Another workaround is to make tern read .babel.js and use the babel module from the project to compile the config file before load, so no need for add babel-core as a dependency to tern.

@eloytoro
Copy link
Contributor Author

eloytoro commented Jun 15, 2017 via email

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

Successfully merging this pull request may close these issues.

3 participants