diff --git a/examples/magic-html/webpack.config.js b/examples/magic-html/webpack.config.js index 30c087549e..444bf6e0a3 100644 --- a/examples/magic-html/webpack.config.js +++ b/examples/magic-html/webpack.config.js @@ -7,9 +7,6 @@ const { setup } = require("../util"); module.exports = setup({ context: __dirname, entry: "./app.js", - experiments: { - outputModule: true, - }, devServer: { magicHtml: true, }, diff --git a/lib/Server.js b/lib/Server.js index 9cffb872e2..94232913c5 100644 --- a/lib/Server.js +++ b/lib/Server.js @@ -15,18 +15,6 @@ if (!process.env.WEBPACK_SERVE) { process.env.WEBPACK_SERVE = true; } -class AssetsInfoPlugin { - constructor(callback) { - this.callback = callback; - } - // eslint-disable-next-line class-methods-use-this - apply(compiler) { - compiler.hooks.done.tap("assets-info-plugin", (stats) => { - this.callback(stats.compilation.assetsInfo); - }); - } -} - class Server { constructor(options = {}, compiler) { // TODO: remove this after plugin support is published @@ -1080,12 +1068,6 @@ class Server { plugin.apply(compiler); } } - - if (this.options.magicHtml) { - new AssetsInfoPlugin((assetsInfo) => { - this.assetsInfo = assetsInfo; - }).apply(this.compiler); - } }); if (this.options.client && this.options.client.progress) { @@ -1962,7 +1944,7 @@ class Server { const splitOutputFilename = outputFilename.split("."); let isOutputModule = false; - this.assetsInfo.forEach((value, key) => { + this.stats.compilation.assetsInfo.forEach((value, key) => { // main.js => ["main", "js"] // main.another.js => ["main", "another", "js"] const splitKey = key.split("."); @@ -1972,7 +1954,7 @@ class Server { // If key = main.other.mjs && filename = main.other => true if ( splitKey.length - 1 === splitOutputFilename.length && - key.split(".")[0] === outputFilename.split(".")[0] + splitKey[0] === outputFilename.split(".")[0] ) { extension = splitKey[splitKey.length - 1]; isOutputModule = value.javascriptModule;