From d95e90edbea3b31dd76d272a816d0cd4e9cb5894 Mon Sep 17 00:00:00 2001 From: Jordan Eldredge Date: Wed, 14 Aug 2019 19:55:47 -0700 Subject: [PATCH] Merge modern into the main Webpack config --- demo/config/webpack.common.js | 9 ++++++- modern/config/webpack.modern.js | 48 --------------------------------- modern/index.html | 1 - package.json | 1 - 4 files changed, 8 insertions(+), 51 deletions(-) delete mode 100644 modern/config/webpack.modern.js diff --git a/demo/config/webpack.common.js b/demo/config/webpack.common.js index 75a7dddb..eb30d9b1 100644 --- a/demo/config/webpack.common.js +++ b/demo/config/webpack.common.js @@ -37,7 +37,7 @@ module.exports = { }, }, { - test: /\.(wsz|mp3|png|ico|jpg|svg)$/, + test: /\.(wsz|wal|mp3|png|ico|jpg|svg)$/, use: [ { loader: "file-loader", @@ -54,6 +54,12 @@ module.exports = { plugins: [ new HtmlWebpackPlugin({ template: "./index.html", + chunks: ["webamp"], + }), + new HtmlWebpackPlugin({ + filename: "modern/index.html", + template: "../modern/index.html", + chunks: ["modern"], }), // Automatically generates the manifest.json file inside the built // directory, and injects a tag into the gererated index.html file @@ -97,6 +103,7 @@ module.exports = { }, entry: { webamp: ["./js/index.js"], + modern: ["../modern/src/index.js"], }, context: path.resolve(__dirname, "../"), output: { diff --git a/modern/config/webpack.modern.js b/modern/config/webpack.modern.js deleted file mode 100644 index 43b41db8..00000000 --- a/modern/config/webpack.modern.js +++ /dev/null @@ -1,48 +0,0 @@ -const path = require("path"); -module.exports = { - devtool: "source-map", - mode: "development", - resolve: { - extensions: [".js", ".ts", ".tsx"], - }, - module: { - rules: [ - { - test: /\.css$/, - use: [ - "style-loader", - { loader: "css-loader", options: { importLoaders: 1 } }, - ], - }, - { - test: /\.(js|ts|tsx)?$/, - exclude: /(node_modules)/, - use: { - loader: "babel-loader", - options: { - envName: "production", - }, - }, - }, - { - test: /\.(wsz|mp3|wal)$/, - use: [ - { - loader: "file-loader", - options: { - emitFile: true, - }, - }, - ], - }, - ], - noParse: [/jszip\.js$/], - }, - devServer: { - contentBase: path.join(__dirname, "../"), - historyApiFallback: true, - }, - entry: { - modern: ["./modern/src/index.js"], - }, -}; diff --git a/modern/index.html b/modern/index.html index 25ab6d90..00a361cd 100644 --- a/modern/index.html +++ b/modern/index.html @@ -9,6 +9,5 @@
- diff --git a/package.json b/package.json index 44c354a6..a1011377 100644 --- a/package.json +++ b/package.json @@ -20,7 +20,6 @@ "prepublishOnly": "npm run build-library", "serve": "http-server ./demo/built", "start": "webpack-dev-server --open --config=demo/config/webpack.dev.js", - "modern": "webpack-dev-server --open --config=modern/config/webpack.modern.js", "stats": "webpack --config=demo/config/webpack.prod.js --json > stats.json", "stats-library": "webpack --config=config/webpack.library.js --json > stats.json", "test": "jest --config=config/jest.unit.js",