fix: correct prod mode

This commit is contained in:
Mike 2024-01-07 22:34:20 -05:00
parent 9f5f75f6a4
commit b357ad8ecc
6 changed files with 24 additions and 11 deletions

3
todo/dist/bundle.js vendored

File diff suppressed because one or more lines are too long

View file

@ -19,7 +19,8 @@
"style-loader": "^3.3.3",
"webpack": "^5.89.0",
"webpack-cli": "^5.1.4",
"webpack-dev-server": "^4.15.1"
"webpack-dev-server": "^4.15.1",
"webpack-merge": "^5.10.0"
}
},
"node_modules/@aashutoshrathi/word-wrap": {

View file

@ -6,8 +6,8 @@
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"watch": "webpack --watch",
"start": "webpack serve --open",
"build": "webpack"
"start": "webpack serve --open --config webpack.dev.js",
"build": "webpack --config webpack.prod.js"
},
"keywords": [],
"author": "",
@ -20,7 +20,8 @@
"style-loader": "^3.3.3",
"webpack": "^5.89.0",
"webpack-cli": "^5.1.4",
"webpack-dev-server": "^4.15.1"
"webpack-dev-server": "^4.15.1",
"webpack-merge": "^5.10.0"
},
"dependencies": {
"date-fns": "^3.0.6"

View file

@ -2,7 +2,6 @@ const path = require('path');
const HtmlWebpackPlugin = require('html-webpack-plugin');
module.exports = {
mode: 'production',
entry: {
index: './src/index.js',
},
@ -16,10 +15,6 @@ module.exports = {
path: path.resolve(__dirname, 'dist'),
clean: true,
},
devtool: 'inline-source-map',
devServer: {
static: './dist',
},
module: {
rules: [
{

11
todo/webpack.dev.js Normal file
View file

@ -0,0 +1,11 @@
const { merge } = require('webpack-merge');
const common = require('./webpack.common.js');
module.exports = merge(common, {
mode: 'development',
devtool: 'inline-source-map',
devServer: {
static: './dist',
},
})

6
todo/webpack.prod.js Normal file
View file

@ -0,0 +1,6 @@
const { merge } = require('webpack-merge');
const common = require('./webpack.common.js');
module.exports = merge(common, {
mode: 'production',
});