-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwebpack.config.js
More file actions
29 lines (28 loc) · 931 Bytes
/
Copy pathwebpack.config.js
File metadata and controls
29 lines (28 loc) · 931 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
const HtmlWebpackPlugin = require('html-webpack-plugin')
const path = require('path')
module.exports = {
mode: 'production', // 'production', 'development'
// entry: [
// './js/index.js',
// './js/index_2.js'
// ], // Start point
entry: './js/index.js', // Start point
output: { // Set output path of bundled file
path: path.resolve(__dirname, 'dist'), // Output path
filename: 'bundle.js' // Output file name
},
devServer: { // Dev server option
port: 3001, // Port
writeToDisk: true
},
plugins: [ // Webpack plugins
new HtmlWebpackPlugin({ // Apply html-webpack-plugin
template: path.resolve(__dirname, 'index.html'), // From template path
filename: path.resolve(__dirname, 'dist/index.html'), // Create template path
inject: true // Inject bundled js file (default set: true)
})
],
optimization: { // Optimization
minimize: true // No minify
}
}