-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebpack.dev.js
42 lines (40 loc) · 1.21 KB
/
webpack.dev.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 webpack = require('webpack');
const HtmlWebPackPlugin = require("html-webpack-plugin");
const MiniCssExtractPlugin = require('mini-css-extract-plugin');
const WorkboxPlugin = require('workbox-webpack-plugin');
const Dotenv = require('dotenv-webpack');
console.log(path.resolve(__dirname, 'src/client/index.js'));
module.exports = {
entry: path.resolve(__dirname, 'src/client/index.js'),
mode: 'development',
optimization: {
minimizer: [],
},
output: {
libraryTarget: 'var',
library: 'Client'
},
plugins: [
new MiniCssExtractPlugin(),
new HtmlWebPackPlugin({
template: path.resolve(__dirname, 'src/client/views/index.html'),
filename: path.resolve(__dirname, 'dist/index.html'),
}),
new WorkboxPlugin.GenerateSW(),
new Dotenv()
],
module: {
rules: [
{
test: '/\.js$/',
exclude: /node_modules/,
loader: "babel-loader"
},
{
test: /\.(s(a|c)ss)$/,
use: [MiniCssExtractPlugin.loader,'css-loader', 'sass-loader']
}
]
}
}