Skip to content

Commit 11ebc21

Browse files
committed
cache is on by default
disable it with cache: false resp. --no-cache @petehunt
1 parent 8af6131 commit 11ebc21

File tree

3 files changed

+15
-8
lines changed

3 files changed

+15
-8
lines changed

bin/config-optimist.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ module.exports = function(optimist) {
4545

4646
.string("target").describe("target")
4747

48-
.boolean("cache").describe("cache")
48+
.boolean("cache").describe("cache").default("cache", true)
4949

5050
.boolean("watch").alias("watch", "w").describe("watch")
5151

bin/convert-argv.js

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -52,13 +52,19 @@ module.exports = function(optimist, argv, convertOptions) {
5252

5353
function mapArgToBoolean(name, optionName) {
5454
ifBooleanArg(name, function() {
55-
options[optionName] = true;
55+
options[optionName || name] = true;
56+
});
57+
}
58+
59+
function mapArgToBooleanInverse(name, optionName) {
60+
ifArg(name, function(bool) {
61+
if(!bool) options[optionName || name] = false;
5662
});
5763
}
5864

5965
function mapArgToPath(name, optionName) {
6066
ifArg(name, function(str) {
61-
options[optionName] = path.resolve(str);
67+
options[optionName || name] = path.resolve(str);
6268
});
6369
}
6470

@@ -228,8 +234,8 @@ module.exports = function(optimist, argv, convertOptions) {
228234
options.target = value;
229235
});
230236

231-
mapArgToBoolean("cache", "cache");
232-
mapArgToBoolean("watch", "watch");
237+
mapArgToBooleanInverse("cache");
238+
mapArgToBoolean("watch");
233239

234240
ifArg("watch-delay", function(value) {
235241
options.watchDelay = value;
@@ -241,7 +247,7 @@ module.exports = function(optimist, argv, convertOptions) {
241247
options.plugins.push(new HotModuleReplacementPlugin());
242248
});
243249

244-
mapArgToBoolean("debug", "debug");
250+
mapArgToBoolean("debug");
245251

246252
ifBooleanArg("progress", function() {
247253
var ProgressPlugin = require("../lib/ProgressPlugin");
@@ -358,9 +364,9 @@ module.exports = function(optimist, argv, convertOptions) {
358364
options.plugins.push(loadPlugin(value));
359365
});
360366

361-
mapArgToBoolean("bail", "bail");
367+
mapArgToBoolean("bail");
362368

363-
mapArgToBoolean("profile", "profile");
369+
mapArgToBoolean("profile");
364370

365371
if(!options.output || !options.output.filename) {
366372
ensureObject(options, "output");

lib/WebpackOptionsDefaulter.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ function WebpackOptionsDefaulter() {
88
OptionsDefaulter.call(this);
99
this.set("debug", false);
1010
this.set("devtool", false);
11+
this.set("cache", true);
1112

1213
this.set("context", process.cwd());
1314
this.set("target", "web");

0 commit comments

Comments
 (0)