-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathwebpack.utils.js
68 lines (63 loc) · 1.39 KB
/
webpack.utils.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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
const webpack = require('webpack')
// const ESLintPlugin = require('eslint-webpack-plugin')
const WebpackModules = require('webpack-modules')
const config = {
entry: './src',
module: {
rules: [
{
test: /\.js$/,
use: 'babel-loader',
// include: __dirname + 'src/*',
exclude: /node_modules/,
},
{
test: /\.mjs/,
type: 'javascript/auto',
use: 'babel-loader',
exclude: /node_modules/,
resolve: {
fullySpecified: false,
},
},
{
test: /\.css$/i,
use: ['style-loader', 'css-loader', 'postcss-loader'],
},
{
test: /\.s[ac]ss$/i,
use: [
'style-loader',
'css-loader',
'postcss-loader',
{
loader: 'sass-loader',
options: {
implementation: require('sass'),
},
},
],
},
{
test: /\.svg$/,
loader: 'svg-inline-loader',
},
{
test: /\.(png|jpe?g|gif)$/i,
loader: 'url-loader',
options: {
name: '[name].[ext]',
outputPath: 'images',
},
},
{ test: /\.json$/, type: 'json' },
],
},
devtool: 'source-map',
}
const plugins = [
new WebpackModules(),
// new ESLintPlugin(),
new webpack.ProgressPlugin(),
]
module.exports = { config, plugins }