Completely updated React, fixed #11, (hopefully)

This commit is contained in:
2018-03-04 19:11:49 -05:00
parent 6e0afd6e2a
commit 34e5f5139a
13674 changed files with 333464 additions and 473223 deletions

View File

@@ -6,6 +6,7 @@
const path = require("path");
const Tapable = require("tapable");
const util = require("util");
const Compilation = require("./Compilation");
const Stats = require("./Stats");
@@ -186,35 +187,30 @@ class Compiler extends Tapable {
loader: null,
context: null
};
let deprecationReported = false;
this.parser = {
plugin: (hook, fn) => {
if(!deprecationReported) {
console.warn("webpack: Using compiler.parser is deprecated.\n" +
"Use compiler.plugin(\"compilation\", function(compilation, data) {\n data.normalModuleFactory.plugin(\"parser\", function(parser, options) { parser.plugin(/* ... */); });\n}); instead. " +
"It was called " + new Error().stack.split("\n")[2].trim() + ".");
deprecationReported = true;
}
this.plugin("compilation", (compilation, data) => {
data.normalModuleFactory.plugin("parser", parser => {
parser.plugin(hook, fn);
plugin: util.deprecate(
(hook, fn) => {
this.plugin("compilation", (compilation, data) => {
data.normalModuleFactory.plugin("parser", parser => {
parser.plugin(hook, fn);
});
});
});
},
apply: () => {
const args = arguments;
if(!deprecationReported) {
console.warn("webpack: Using compiler.parser is deprecated.\n" +
"Use compiler.plugin(\"compilation\", function(compilation, data) {\n data.normalModuleFactory.plugin(\"parser\", function(parser, options) { parser.apply(/* ... */); });\n}); instead. " +
"It was called " + new Error().stack.split("\n")[2].trim() + ".");
deprecationReported = true;
}
this.plugin("compilation", (compilation, data) => {
data.normalModuleFactory.plugin("parser", parser => {
parser.apply.apply(parser, args);
},
"webpack: Using compiler.parser is deprecated.\n" +
"Use compiler.plugin(\"compilation\", function(compilation, data) {\n data.normalModuleFactory.plugin(\"parser\", function(parser, options) { parser.plugin(/* ... */); });\n}); instead. "
),
apply: util.deprecate(
() => {
const args = arguments;
this.plugin("compilation", (compilation, data) => {
data.normalModuleFactory.plugin("parser", parser => {
parser.apply.apply(parser, args);
});
});
});
}
},
"webpack: Using compiler.parser is deprecated.\n" +
"Use compiler.plugin(\"compilation\", function(compilation, data) {\n data.normalModuleFactory.plugin(\"parser\", function(parser, options) { parser.apply(/* ... */); });\n}); instead. "
)
};
this.options = {};