mirror of
https://github.com/captbaritone/webamp.git
synced 2026-01-23 10:15:31 +00:00
Merge modern into the main Webpack config
This commit is contained in:
parent
82b685f08b
commit
d95e90edbe
4 changed files with 8 additions and 51 deletions
|
|
@ -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: {
|
||||
|
|
|
|||
|
|
@ -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"],
|
||||
},
|
||||
};
|
||||
|
|
@ -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>
|
||||
|
|
|
|||
|
|
@ -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",
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue