mirror of https://github.com/webpack/webpack.git
added `--define` #100
This commit is contained in:
parent
672fc9ba0f
commit
25515b200a
|
@ -37,6 +37,8 @@ module.exports = function(optimist) {
|
|||
|
||||
.string("records-path").describe("records-path")
|
||||
|
||||
.string("define").describe("define")
|
||||
|
||||
.string("target").describe("target")
|
||||
|
||||
.boolean("cache").describe("cache")
|
||||
|
|
|
@ -139,6 +139,16 @@ module.exports = function(optimist, argv, convertOptions) {
|
|||
ensureArray(options.module, "postLoaders");
|
||||
});
|
||||
|
||||
ifArgPair("define", function(name, value) {
|
||||
if(name === null) {
|
||||
name = value;
|
||||
value = true;
|
||||
}
|
||||
options.define[name] = value;
|
||||
}, function() {
|
||||
ensureObject(options, "define");
|
||||
});
|
||||
|
||||
ifArg("output-path", function(value) {
|
||||
ensureObject(options, "output");
|
||||
options.output.path = value;
|
||||
|
|
Loading…
Reference in New Issue