string-replace-loader-dev-options
v0.3.1
Published
Return string-replace-loader's option which is useful for development.
Downloads
1
Maintainers
Readme
string-replace-loader-dev-options
Webpackのloaderの1つであるstring-replace-loader の開発時に便利なオプションを返す。
Read this in other languages: Engulish
Installation
npm i -D string-replace-loader-dev-options
Usage
js用のオプションを使う場合、webpack.config.js
を次のようにしてください:
var stringReplaceLoaderDevOptions = require('string-replace-loader-dev-options');
module.exports = (env, argv) => {
var isProd = argv.mode === 'production';
return {
// ...
module: {
rules: [
{
test: /\.js$/,
use: [
// other loaders
// ...
stringReplaceLoaderDevOptions.js({isProd: isProd})
]
}
]
}
};
}
Available functions
License
MIT