Merge modern into the main Webpack config

This commit is contained in:
Jordan Eldredge 2019-08-14 19:55:47 -07:00
parent ac423e6aee
commit 3a63481a8f
4 changed files with 8 additions and 51 deletions

View File

@ -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: {

View File

@ -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"],
},
};

View File

@ -9,6 +9,5 @@
<body>
<noscript>You need to enable JavaScript to run this app.</noscript>
<div id="root"></div>
<script src="./modern.js"></script>
</body>
</html>

View File

@ -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",