babel-plugin-webpack-loaders-inline-exports
Make webpack-loaders inline exports
webpack-loaders is cool, but it did some transforms from loader compiled result.
For each matched loader, they could transform as a commonjs module
moduleexports =
and we can just pick the webpackResult as inline exports
const txt = ;
will be
const txt = ;
And for some loader, they may exports with other dependences, but it will works well. in this plugin, webpackConfig will be overwrite by the special config below:
entry: filename output: libraryTarget: 'commonjs2' externals: { if subRequest !== filename ; else ; }
To make sure only process the target file which is matched by loader.
Options
all options same as webpack, and we can assign a config by the webpack config file
special options in babel option for this plugin will merge into webpack config.
For ava
user, add set env var $PWD
is needed;
Warning
- Please use this only in Node.
- And for
css-loader
, should use withextract-text-webpack-plugin
and don't use withstyle-loader
BABEL_DISABLE_CACHE=1
may used