Skip to content

feat: allow config transpiling (babel, typescript, etc) #6

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

Merged
merged 2 commits into from
Dec 13, 2018

Conversation

shellscape
Copy link
Owner

This PR contains:

  • bugfix
  • feature
  • refactor
  • tests
  • documentation
  • metadata

Breaking Changes?

  • yes
  • no

If yes, please describe the breakage.

Please Describe Your Changes

Fixes #5. Introduces support for transpiling webpack configs on the fly. This allows users to use babel (webpack.config.babel.js, webpack.config.es6), typescript (webpack.config.ts), and other module loaders to write their webpack configs. Users are responsible for installing the necessary dependency(s) for the module loader that matches their file type.

This is the full list of file extensions supported, along with the loaders looked for when using a file type in this list:

  '.babel.js': ['@babel/register', 'babel-register', 'babel-core/register', 'babel/register'],
  '.babel.ts': ['@babel/register'],
  '.es6': ['@babel/register'],
  '.mjs': ['@babel/register'],
  '.ts': [
    'ts-node/register',
    'typescript-node/register',
    'typescript-register',
    'typescript-require'
  ]

If a config file type is used which is not in that list, the Node require pipeline will attempt to load the file. If a module loader is not installed for a special file type, webpack-nano will throw an error.

@shellscape
Copy link
Owner Author

ping @j-walker23. this should suit your needs.

@shellscape shellscape merged commit 67998d9 into master Dec 13, 2018
@shellscape shellscape deleted the feat/config-transpile branch December 13, 2018 18:37
@j-walker23
Copy link

@shellscape you are the man. Thank you!

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.

Allow webpack.config.babel.js
4 participants