webpack/test/configCases/plugins/define-plugin/webpack.config.js

25 lines
545 B
JavaScript
Raw Normal View History

var DefinePlugin = require("../../../../lib/DefinePlugin");
module.exports = {
plugins: [
new DefinePlugin({
2015-03-06 05:58:03 +08:00
TRUE: true,
FALSE: false,
UNDEFINED: undefined,
FUNCTION: function(a) { return a + 1; },
CODE: "(1+2)",
REGEXP: /abc/i,
OBJECT: {
SUB: {
UNDEFINED: undefined,
FUNCTION: function(a) { return a + 1; },
2015-03-06 04:49:22 +08:00
CODE: "(1+2)",
2016-11-10 15:52:00 +08:00
REGEXP: /abc/i,
STRING: JSON.stringify("string")
}
},
2016-11-10 15:52:00 +08:00
"process.env.DEFINED_NESTED_KEY": 5,
"process.env.DEFINED_NESTED_KEY_STRING": "\"string\""
})
]
}