mirror of https://github.com/webpack/webpack.git
Allow mixing different webpack versions
This commit is contained in:
parent
8c2327e0b7
commit
a70f91499a
|
|
@ -5,6 +5,8 @@
|
|||
var ConstDependency = require("./dependencies/ConstDependency");
|
||||
var BasicEvaluatedExpression = require("./BasicEvaluatedExpression");
|
||||
|
||||
var NullFactory = require("./NullFactory");
|
||||
|
||||
function APIPlugin() {
|
||||
}
|
||||
module.exports = APIPlugin;
|
||||
|
|
@ -25,6 +27,10 @@ var REPLACEMENT_TYPES = {
|
|||
var IGNORES = [
|
||||
];
|
||||
APIPlugin.prototype.apply = function(compiler) {
|
||||
compiler.plugin("compilation", function(compilation, params) {
|
||||
compilation.dependencyFactories.set(ConstDependency, new NullFactory());
|
||||
compilation.dependencyTemplates.set(ConstDependency, new ConstDependency.Template());
|
||||
});
|
||||
Object.keys(REPLACEMENTS).forEach(function(key) {
|
||||
compiler.parser.plugin("expression "+key, function(expr) {
|
||||
var dep = new ConstDependency(REPLACEMENTS[key], expr.range);
|
||||
|
|
|
|||
|
|
@ -7,11 +7,17 @@ var ConstDependency = require("./dependencies/ConstDependency");
|
|||
|
||||
var ModuleAliasPlugin = require("enhanced-resolve/lib/ModuleAliasPlugin");
|
||||
|
||||
var NullFactory = require("./NullFactory");
|
||||
|
||||
function CompatibilityPlugin() {
|
||||
}
|
||||
module.exports = CompatibilityPlugin;
|
||||
|
||||
CompatibilityPlugin.prototype.apply = function(compiler) {
|
||||
compiler.plugin("compilation", function(compilation, params) {
|
||||
compilation.dependencyFactories.set(ConstDependency, new NullFactory());
|
||||
compilation.dependencyTemplates.set(ConstDependency, new ConstDependency.Template());
|
||||
});
|
||||
compiler.resolvers.normal.apply(
|
||||
new ModuleAliasPlugin({
|
||||
"enhanced-require": path.join(__dirname, "..", "buildin", "return-require.js")
|
||||
|
|
|
|||
|
|
@ -5,11 +5,17 @@
|
|||
var ConstDependency = require("./dependencies/ConstDependency");
|
||||
var BasicEvaluatedExpression = require("./BasicEvaluatedExpression");
|
||||
|
||||
var NullFactory = require("./NullFactory");
|
||||
|
||||
function DefinePlugin(definitions) {
|
||||
this.definitions = definitions;
|
||||
}
|
||||
module.exports = DefinePlugin;
|
||||
DefinePlugin.prototype.apply = function(compiler) {
|
||||
compiler.plugin("compilation", function(compilation, params) {
|
||||
compilation.dependencyFactories.set(ConstDependency, new NullFactory());
|
||||
compilation.dependencyTemplates.set(ConstDependency, new ConstDependency.Template());
|
||||
});
|
||||
(function walkDefinitions(definitions, prefix) {
|
||||
Object.keys(definitions).forEach(function(key) {
|
||||
var code = definitions[key];
|
||||
|
|
|
|||
|
|
@ -9,11 +9,17 @@ var ConstDependency = require("./dependencies/ConstDependency");
|
|||
var BasicEvaluatedExpression = require("./BasicEvaluatedExpression");
|
||||
var UnsupportedFeatureWarning = require("./UnsupportedFeatureWarning");
|
||||
|
||||
var NullFactory = require("./NullFactory");
|
||||
|
||||
function NodeStuffPlugin(options) {
|
||||
this.options = options;
|
||||
}
|
||||
module.exports = NodeStuffPlugin;
|
||||
NodeStuffPlugin.prototype.apply = function(compiler) {
|
||||
compiler.plugin("compilation", function(compilation, params) {
|
||||
compilation.dependencyFactories.set(ConstDependency, new NullFactory());
|
||||
compilation.dependencyTemplates.set(ConstDependency, new ConstDependency.Template());
|
||||
});
|
||||
function ignore() { return true; }
|
||||
var context = compiler.context;
|
||||
if(this.options.__filename == "mock") {
|
||||
|
|
|
|||
|
|
@ -5,10 +5,16 @@
|
|||
var path = require("path");
|
||||
var ConstDependency = require("./dependencies/ConstDependency");
|
||||
|
||||
var NullFactory = require("./NullFactory");
|
||||
|
||||
function RequireJsStuffPlugin() {
|
||||
}
|
||||
module.exports = RequireJsStuffPlugin;
|
||||
RequireJsStuffPlugin.prototype.apply = function(compiler) {
|
||||
compiler.plugin("compilation", function(compilation, params) {
|
||||
compilation.dependencyFactories.set(ConstDependency, new NullFactory());
|
||||
compilation.dependencyTemplates.set(ConstDependency, new ConstDependency.Template());
|
||||
});
|
||||
function remove(expr) {
|
||||
var dep = new ConstDependency(";", expr.range);
|
||||
dep.loc = expr.loc;
|
||||
|
|
|
|||
|
|
@ -3,7 +3,6 @@
|
|||
Author Tobias Koppers @sokra
|
||||
*/
|
||||
var AbstractPlugin = require("../AbstractPlugin");
|
||||
var ConstDependency = require("./ConstDependency");
|
||||
var LabeledModuleDependency = require("./LabeledModuleDependency");
|
||||
var LabeledExportsDependency = require("./LabeledExportsDependency");
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue