/
config.defaults.js
118 lines (97 loc) · 3.41 KB
/
config.defaults.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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
// config.defaults.js
module.exports = {
path: {
// Source files
src: './src',
// Output path
dist: './dist',
// Path to assets json file, relative to "dist".
assetsJson: 'assets.json',
},
// Defines global variables that will be available in code.
// Default variables will be added to this object.
globals: {},
javascript: {
// Webpack's entry: https://webpack.js.org/concepts/entry-points/
// Tip: As a rule of thumb: Use exactly one entry point for each HTML document.
// See the issue described here for more details:
// https://bundlers.tooling.report/code-splitting/multi-entry/#webpack
entry: {
index: './src/index.js',
},
// If you have multiple entry points on a page, set this `true`.
singleRuntimeChunk: false,
// Use babel (core-js) polyfills: 'auto' | 'manual' | false.
polyfill: 'auto',
// https://webpack.js.org/plugins/provide-plugin/
// Automatically load modules instead of having to import or
// require them everywhere.
providePlugin: {
// Example:
// $: 'jquery', // in a module: $('#item'); <= works
// jQuery: 'jquery', // in a module: jQuery('#item'); <= works
},
},
css: {
// Base size for converting pixels to rems. Set `false` to prevent
// converting pixels to rems. It's available in scss.
baseFontSize: 16,
// Group and sort media queries (mobile/desktop first way).
// Set `false` to prevent grouping and sorting media queries.
sortMQ: 'mobile-first',
// Removes unused selectors from css. Removed selectors can be found
// in the `logs` folder in the project's root.
// Set `purge: false` to prevent purging css.
purge: {
keepSelectors: [],
},
},
templates: {
// simple-nunjucks-loader options
// https://www.npmjs.com/package/simple-nunjucks-loader
nunjucksOptions: {},
// Use a different loader for templates
customLoader: {
// Test files: an array, will be converted to regex.
fileTypes: [],
// Array of objects with 'loader' and 'options' properties,
// just like webpack's `module.rules` or `use: []`.
use: [],
},
},
svg: {
extractFrom: ['html', 'css'],
optimize: {
removeTitle: true,
removeDesc: true,
removeComments: true,
removeMetadata: false,
cleanupIds: true,
removeDoctype: true,
removeViewBox: true,
},
},
images: {
// Images quality 0-100.
quality: 80,
},
licenses: {
// License file is being created automatically for JavaScript packages.
// For sass packages, use the `include` array (the name of the package).
// Example: `include: ['some-module'],`
include: [],
// Exclude unwanted licenses. Example: `exclude: ['some-module'],`
exclude: [],
// When using a package with one of these licenses, webpack will
// throw an error. Completely overwritten with user's config.
unacceptable: ['GPL', 'AGPL', 'LGPL', 'NGPL'],
},
server: {
// Local backend domain, e.g. 'http://abstraction.local',
// for development with a CMS.
backend: undefined,
// https://webpack.js.org/configuration/dev-server/
// Complete devServer config, merged with the default.
devServer: {},
},
};