Skip to content

Commit 25515b2

Browse files
committed
added --define webpack#100
1 parent 672fc9b commit 25515b2

2 files changed

Lines changed: 12 additions & 0 deletions

File tree

bin/config-optimist.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,8 @@ module.exports = function(optimist) {
3737

3838
.string("records-path").describe("records-path")
3939

40+
.string("define").describe("define")
41+
4042
.string("target").describe("target")
4143

4244
.boolean("cache").describe("cache")

bin/convert-argv.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,16 @@ module.exports = function(optimist, argv, convertOptions) {
139139
ensureArray(options.module, "postLoaders");
140140
});
141141

142+
ifArgPair("define", function(name, value) {
143+
if(name === null) {
144+
name = value;
145+
value = true;
146+
}
147+
options.define[name] = value;
148+
}, function() {
149+
ensureObject(options, "define");
150+
});
151+
142152
ifArg("output-path", function(value) {
143153
ensureObject(options, "output");
144154
options.output.path = value;

0 commit comments

Comments
 (0)