Skip to content

Commit 6c3f51e

Browse files
committed
updated some small things on the cli
1 parent 1961277 commit 6c3f51e

File tree

3 files changed

+20
-3
lines changed

3 files changed

+20
-3
lines changed

bin/config-optimist.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ module.exports = function(optimist) {
2727

2828
.string("output-library-target").describe("output-library-target")
2929

30-
.boolean("console").describe("console")
30+
.string("target").describe("target")
3131

3232
.boolean("cache").describe("cache")
3333

@@ -49,6 +49,8 @@ module.exports = function(optimist) {
4949

5050
.boolean("optimize-minimize").describe("optimize-minimize")
5151

52+
.string("provide").describe("provide")
53+
5254
.string("plugin").describe("plugin")
5355

5456
.boolean("bail").describe("bail");

bin/convert-argv.js

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,10 @@ module.exports = function(optimist, argv, convertOptions) {
168168
options.output.libraryTarget = value;
169169
});
170170

171-
mapArgToBoolean("console", "console");
171+
ifArg("target", function(value) {
172+
options.target = value;
173+
});
174+
172175
mapArgToBoolean("cache", "cache");
173176
mapArgToBoolean("watch", "watch");
174177

@@ -231,6 +234,18 @@ module.exports = function(optimist, argv, convertOptions) {
231234
options.optimize.minimize = true;
232235
});
233236

237+
ifArg("provide", function(value) {
238+
ensureObject(options, "provide");
239+
var idx = value.indexOf("=");
240+
if(idx >= 0) {
241+
var name = value.substr(0, idx);
242+
value = value.substr(idx + 1);
243+
} else {
244+
var name = value;
245+
}
246+
options.provide[name] = value;
247+
});
248+
234249
ifArg("plugin", function(value) {
235250
ensureArray(options, "plugins");
236251
options.plugins.push(loadPlugin(value));

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "webpack",
3-
"version": "0.9.2",
3+
"version": "0.9.3",
44
"author": "Tobias Koppers @sokra",
55
"description": "Packs CommonJs/AMD/Labeled Modules for the browser. Allows to split your codebase into multiple bundles, which can be loaded on demand. Support loaders to preprocess files, i.e. json, jade, coffee, css, less, ... and your custom stuff.",
66
"dependencies": {

0 commit comments

Comments
 (0)