@beanutils/define
v0.1.1
Published
Define global variable for webpack DefinePlugin
Downloads
2
Readme
@beanutils/define
Define global variable for webpack DefinePlugin.
Install
npm install --save @beanutils/define
Usage
package.json
"dependencies": {
...
},
"devDependencies": {
...
},
"global": {
"WWW": "http://localhost:8080",
"SEARCH": "http://localhost:8081",
"REPORT": "http://localhost:8082",
"MAP": "http://localhost:8083"
}
webpack.config.dev.babel.js
import { define } from '@beanutils/define';
import pkg from './package.json';
var global = pkg.global;
new webpack.DefinePlugin({
__DEV__: true,
'process.env.NODE_ENV': JSON.stringify('development')
...define(global)
})
API
function define(options, prefix = '__', suffix = '__');