Skip to content

Commit 1a449ce

Browse files
committed
better config file check, added hook for VariableDeclarators
1 parent ea1f060 commit 1a449ce

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

bin/convert-argv.js

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
var path = require("path");
2+
var fs = require("fs");
23
var resolve = require("enhanced-resolve");
34

45
module.exports = function(optimist, argv, convertOptions) {
@@ -75,11 +76,9 @@ module.exports = function(optimist, argv, convertOptions) {
7576
if(argv.config) {
7677
options = require(path.resolve(argv.config));
7778
} else {
78-
try {
79-
options = require(path.resolve("webpack.config.js"));
80-
} catch(e) {
81-
options = {};
82-
}
79+
var configPath = path.resolve("webpack.config.js");
80+
if(fs.existsSync(configPath))
81+
options = require(configPath);
8382
}
8483
if(typeof options != "object" || options === null) {
8584
console.log("Config did not export a object.");

lib/Parser.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -324,7 +324,8 @@ Parser.prototype.walkVariableDeclarators = function walkVariableDeclarators(decl
324324
switch(declarator.type) {
325325
case "VariableDeclarator":
326326
if(declarator.id.type === "Identifier") {
327-
this.scope.definitions.push(declarator.id.name);
327+
if(!this.applyPluginsBailResult("var " + declarator.id.name))
328+
this.scope.definitions.push(declarator.id.name);
328329
}
329330
if(declarator.init)
330331
this.walkExpression(declarator.init);

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.0-beta26",
3+
"version": "0.9.0-beta27",
44
"author": "Tobias Koppers @sokra",
55
"description": "Packs CommonJs/AMD 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)