-
Notifications
You must be signed in to change notification settings - Fork 2
/
webpack.config.js
43 lines (40 loc) · 963 Bytes
/
webpack.config.js
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
42
const path = require('path');
const MiniCssExtractPlugin = require('mini-css-extract-plugin');
const BrowserSyncPlugin = require('browser-sync-webpack-plugin');
// https://webpack.js.org/configuration/
module.exports = {
entry: {
main: path.join(__dirname, '_webpack', 'main'),
},
output: {
path: path.resolve(__dirname, 'assets'),
filename: '[name]-bundle.js',
},
resolve: {
extensions: ['.json', '.js', '.jsx'],
modules: ['node_modules'],
},
plugins: [
new MiniCssExtractPlugin({filename:"main.css"}),
new BrowserSyncPlugin({
host: 'localhost',
port: 4000,
server: { baseDir: ['_site'] }
})
],
optimization: {
},
module: {
rules: [
{ test: /\.js$/, exclude: /node_modules/, loader: 'babel-loader' },
{
test: /\.css$/,
use: [
MiniCssExtractPlugin.loader,
"css-loader",
"postcss-loader"
],
},
],
},
};