Skip to content

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

5 participants