Created
January 16, 2020 15:29
-
-
Save tommylinks/399ba7b95038f8709c97a20335bfc942 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//scripts for package.json | |
// "scripts": { | |
// "start": "webpack-dev-server --mode development --open", | |
// "build": "webpack --mode production" | |
// }, | |
const path = require('path') | |
const HTMLPlugin = require('html-webpack-plugin') | |
const { CleanWebpackPlugin } = require('clean-webpack-plugin') | |
module.exports = { | |
entry: './src/app.js', | |
output: { | |
filename: 'bundle.[chunkhash].js', | |
path: path.resolve(__dirname, 'public') | |
}, | |
devServer: { | |
port: 3000 | |
}, | |
plugins: [ | |
new HTMLPlugin({ | |
template: './src/index.html' | |
}), | |
new CleanWebpackPlugin() | |
], | |
module: { | |
rules: [ | |
{ | |
test: /\.css$/i, | |
use: ['style-loader', 'css-loader'], | |
}, | |
], | |
}, | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment