-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwebpack.dev.js
More file actions
41 lines (37 loc) · 1.06 KB
/
webpack.dev.js
File metadata and controls
41 lines (37 loc) · 1.06 KB
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
30
31
32
33
34
35
36
37
38
39
40
41
const path = require('path');
const HtmlWebPackPlugin = require("html-webpack-plugin");
const MiniCssExtractPlugin = require('mini-css-extract-plugin');
//loaders
const htmlLoader = require('./webpack-modules/loaders/html.js');
const babelLoader = require('./webpack-modules/loaders/babel.js');
const postCssLoader = require('./webpack-modules/loaders/postcss-prod.js');
module.exports = {
mode: "development",
entry: './src/main.js',
devtool: 'inline-source-map',
devServer: {
contentBase: false, // path.join(__dirname, 'static-files-folder'),
compress: true,
port: 9000
},
resolve: {
alias: {
components: path.resolve(__dirname, 'src/components')
}
},
module: {
rules: [
{...babelLoader},
{...htmlLoader},
{...postCssLoader}
]
},
plugins: [
new HtmlWebPackPlugin({
template: path.resolve(__dirname, 'index.html')
}),
new MiniCssExtractPlugin({
filename: '[name].css'
})
]
};