purpose
an easy string or object babel loader
installation
npm i --save-dev babel-loader-builder
usage
(in webpack.config
)
as a string
const babelLoaderString = // ... loaders: test: /\.js?$/ loaders: babelLoaderString // ...
as an object
const babelLoaderObject = // ...loaders: test: /\.js?$/ loaders: 'babel-loader' query: loader // ...
defaults
var defaults = {
hot: false,
react: false,
asObject: false,
production: false,
babelrc: false,
cacheDirectory: true,
babili: false,
moduleExports: true,
inferno: false,
}
todo
- show required installations if some are missing
- if they are missing, write out a line that shows the installation npm i command
- stringify the object queries such as inferno for usage as a string
- just loop instead of Object.assign, for compatibility, or use polyfill but that seems like overkill