mirror of https://github.com/webpack/webpack.git
Remove webpack.web.js and its deps
This commit is contained in:
parent
6623a2e292
commit
854bdafce4
|
|
@ -1,18 +0,0 @@
|
|||
/*
|
||||
MIT License http://www.opensource.org/licenses/mit-license.php
|
||||
Author Tobias Koppers @sokra
|
||||
*/
|
||||
"use strict";
|
||||
|
||||
class WebEnvironmentPlugin {
|
||||
constructor(inputFileSystem, outputFileSystem) {
|
||||
this.inputFileSystem = inputFileSystem;
|
||||
this.outputFileSystem = outputFileSystem;
|
||||
}
|
||||
|
||||
apply(compiler) {
|
||||
compiler.outputFileSystem = this.outputFileSystem;
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = WebEnvironmentPlugin;
|
||||
|
|
@ -1,31 +0,0 @@
|
|||
/*
|
||||
MIT License http://www.opensource.org/licenses/mit-license.php
|
||||
Author Tobias Koppers @sokra
|
||||
*/
|
||||
"use strict";
|
||||
|
||||
const Compiler = require("./Compiler");
|
||||
const WebEnvironmentPlugin = require("./web/WebEnvironmentPlugin");
|
||||
const WebpackOptionsApply = require("./WebpackOptionsApply");
|
||||
const WebpackOptionsDefaulter = require("./WebpackOptionsDefaulter");
|
||||
|
||||
const webpack = (options, callback) => {
|
||||
new WebpackOptionsDefaulter().process(options);
|
||||
|
||||
const compiler = new Compiler();
|
||||
compiler.options = new WebpackOptionsApply().process(options, compiler);
|
||||
new WebEnvironmentPlugin(
|
||||
options.inputFileSystem,
|
||||
options.outputFileSystem
|
||||
).apply(compiler);
|
||||
if (callback) {
|
||||
compiler.run(callback);
|
||||
}
|
||||
return compiler;
|
||||
};
|
||||
module.exports = webpack;
|
||||
|
||||
webpack.WebpackOptionsDefaulter = WebpackOptionsDefaulter;
|
||||
webpack.WebpackOptionsApply = WebpackOptionsApply;
|
||||
webpack.Compiler = Compiler;
|
||||
webpack.WebEnvironmentPlugin = WebEnvironmentPlugin;
|
||||
|
|
@ -90,7 +90,6 @@
|
|||
},
|
||||
"homepage": "https://github.com/webpack/webpack",
|
||||
"main": "lib/webpack.js",
|
||||
"web": "lib/webpack.web.js",
|
||||
"bin": "./bin/webpack.js",
|
||||
"files": [
|
||||
"lib/",
|
||||
|
|
|
|||
|
|
@ -1,23 +0,0 @@
|
|||
"use strict";
|
||||
|
||||
const WebEnvironmentPlugin = require("../lib/web/WebEnvironmentPlugin");
|
||||
|
||||
describe("WebEnvironmentPlugin", () => {
|
||||
describe("apply", () => {
|
||||
const WebEnvironmentPluginInstance = new WebEnvironmentPlugin(
|
||||
"inputFileSystem",
|
||||
"outputFileSystem"
|
||||
);
|
||||
const compileSpy = {
|
||||
outputFileSystem: "otherOutputFileSystem"
|
||||
};
|
||||
|
||||
WebEnvironmentPluginInstance.apply(compileSpy);
|
||||
|
||||
it("should set compiler.outputFileSystem information with the same as set in WebEnvironmentPlugin", () => {
|
||||
expect(compileSpy.outputFileSystem).toBe(
|
||||
WebEnvironmentPluginInstance.outputFileSystem
|
||||
);
|
||||
});
|
||||
});
|
||||
});
|
||||
Loading…
Reference in New Issue