0.1.0 • Published 5 years ago
inject-config-loader v0.1.0
inject-config-loader
inject config into webpack bundle
Install
yarn add -D inject-config-loader
Usage
// webpack.config.js
module.exports = {
// ...
resolve: {
alias: {
config: path.join(__dirname, 'source/dummy.config')
}
},
module: {
rules: [
{
test: /\.config$/,
use: [
{
loader: 'inject-config-loader',
options: {
field: 'front'
}
}
]
}
]
},
// ...
}
Options
field (string)
Name of a config property that will be injected. By default whole config is injected.
cache (bool)
Default value: true (recommended for production). If false, all changes in config files will trigger an incremental build.
Example
See sample webpack.config.js in demo folder.