-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwebpack.base.conf.js
More file actions
85 lines (73 loc) · 2.34 KB
/
webpack.base.conf.js
File metadata and controls
85 lines (73 loc) · 2.34 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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
const path = require('path')
const CopyWebpackPlugin = require('copy-webpack-plugin')
const webpackConfig = {
entry: { app: './src/index.js' },
output: {
path: path.resolve(path.dirname(__dirname), 'dist'), // string
filename: '[name].js' // string
},
module: {
// configuration regarding modules
rules: [
// rules for modules (configure loaders, parser options, etc.)
{
test: /\.jsx?$/,
include: [path.resolve('./src')],
use: [
{
loader: 'cache-loader',
options: {
// provide a cache directory where cache items should be stored
cacheDirectory: path.resolve('./.cache')
}
},
{
loader: 'babel-loader',
options: {
cacheDirectory: './.cache/'
}
}
]
},
{
test: /\.html$/,
use: [
{
loader: 'html-loader'
}
]
}
// use all of these nested rules (combine with conditions to be useful)
]
},
resolve: {
// options for resolving module requests
modules: ['node_modules', 'src'],
// directories where to look for modules
extensions: ['.js', '.jsx'],
// extensions that are used
alias: {
// a list of module name aliases
}
},
performance: {
hints: false // enum
},
devtool: false, // enum
// context: path.dirname(__dirname), // string (absolute path!)
// the home directory for webpack
target: 'web', // enum
stats: 'errors-only',
// lets you precisely control what bundle information gets displayed
plugins: [],
parallelism: 2, // number
// limit the number of parallel processed modules
profile: true, // boolean
// capture timing information
bail: false, //boolean
// fail out on the first error instead of tolerating it.
cache: false, // boolean
// disable/enable caching
watch: false
}
module.exports = webpackConfig