-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathwebpack.config.js
More file actions
63 lines (60 loc) · 1.44 KB
/
webpack.config.js
File metadata and controls
63 lines (60 loc) · 1.44 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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
const path = require('path')
const HtmlWebpackPlugin = require('html-webpack-plugin')
const CopyWebpackPlugin = require('copy-webpack-plugin')
const ROOT_DIRECTORY = path.join(__dirname, '..')
const SRC_DIRECTORY = path.join(ROOT_DIRECTORY, 'src')
const config = {
entry: [path.resolve(__dirname, './src/index.js')],
output: {
path: path.resolve(__dirname, './build'),
filename: 'bundle.js',
publicPath: '/'
},
mode: 'development',
resolve: {
modules: [path.resolve('node_modules'), 'node_modules']
},
performance: {
hints: false
},
plugins: [
new HtmlWebpackPlugin({
template: path.join(SRC_DIRECTORY, '../public/index.html')
}),
// new CopyWebpackPlugin(
// {
// patterns: [
// { from: path.join(SRC_DIRECTORY, 'assets'), to: path.join(ROOT_DIRECTORY, 'build') }
// ]
// }
// )
],
module: {
rules: [
{ test: /\.js$/, exclude: /node_modules/, loader: 'babel-loader' },
{
test: /\.(sass|css|scss)$/,
use: [
'style-loader',
'css-loader',
{
loader: "postcss-loader",
options: {
plugins: () => [
require("autoprefixer")()
],
},
},
'sass-loader',
]
},
{
test: /\.(png|svg|jpg|gif|pdf)$/,
use: [
'file-loader'
]
}
]
}
}
module.exports = config