Skip to content

Commit 273506e

Browse files
committed
fix for RegExp evalutating, change in node-libs-browser
1 parent ffc2ace commit 273506e

File tree

3 files changed

+5
-3
lines changed

3 files changed

+5
-3
lines changed

lib/Parser.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@ Parser.prototype.initializeEvaluating = function() {
3333
case "boolean":
3434
return new BasicEvaluatedExpression().setBoolean(expr.value).setRange(expr.range);
3535
}
36+
if(expr.value instanceof RegExp)
37+
return new BasicEvaluatedExpression().setRegExp(expr.value).setRange(expr.range);
3638
});
3739
this.plugin("evaluate BinaryExpression", function(expr) {
3840
if(expr.operator == "+") {

lib/node/NodeSourcePlugin.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,15 @@ module.exports = NodeSourcePlugin;
1414
NodeSourcePlugin.prototype.apply = function(compiler) {
1515
function ignore() { return true; }
1616
compiler.parser.plugin("expression process", function(expr) {
17-
return ModuleParserHelpers.addParsedVariable(this, "process", "require(" + JSON.stringify(nodeLibsBrowser.best._process) + ")");
17+
return ModuleParserHelpers.addParsedVariable(this, "process", "require(" + JSON.stringify(nodeLibsBrowser._process) + ")");
1818
});
1919
compiler.parser.plugin("expression global", function(expr) {
2020
this.state.current.addVariable("global", "this");
2121
return true;
2222
});
2323
compiler.plugin("after-resolvers", function(compiler) {
2424
compiler.resolvers.normal.apply(
25-
new ModuleAliasPlugin(nodeLibsBrowser.best)
25+
new ModuleAliasPlugin(nodeLibsBrowser)
2626
);
2727
});
2828
};

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-beta30",
3+
"version": "0.9.0-beta31",
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)