fix for RegExp evalutating, change in node-libs-browser

This commit is contained in:
Tobias Koppers 2013-02-25 18:18:49 +01:00
parent ffc2ace8d6
commit 273506ee34
3 changed files with 5 additions and 3 deletions

View File

@ -33,6 +33,8 @@ Parser.prototype.initializeEvaluating = function() {
case "boolean":
return new BasicEvaluatedExpression().setBoolean(expr.value).setRange(expr.range);
}
if(expr.value instanceof RegExp)
return new BasicEvaluatedExpression().setRegExp(expr.value).setRange(expr.range);
});
this.plugin("evaluate BinaryExpression", function(expr) {
if(expr.operator == "+") {

View File

@ -14,7 +14,7 @@ module.exports = NodeSourcePlugin;
NodeSourcePlugin.prototype.apply = function(compiler) {
function ignore() { return true; }
compiler.parser.plugin("expression process", function(expr) {
return ModuleParserHelpers.addParsedVariable(this, "process", "require(" + JSON.stringify(nodeLibsBrowser.best._process) + ")");
return ModuleParserHelpers.addParsedVariable(this, "process", "require(" + JSON.stringify(nodeLibsBrowser._process) + ")");
});
compiler.parser.plugin("expression global", function(expr) {
this.state.current.addVariable("global", "this");
@ -22,7 +22,7 @@ NodeSourcePlugin.prototype.apply = function(compiler) {
});
compiler.plugin("after-resolvers", function(compiler) {
compiler.resolvers.normal.apply(
new ModuleAliasPlugin(nodeLibsBrowser.best)
new ModuleAliasPlugin(nodeLibsBrowser)
);
});
};

View File

@ -1,6 +1,6 @@
{
"name": "webpack",
"version": "0.9.0-beta30",
"version": "0.9.0-beta31",
"author": "Tobias Koppers @sokra",
"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.",
"dependencies": {