-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebpack.config.js
45 lines (44 loc) · 1.17 KB
/
webpack.config.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
const path = require('path')
const prod = false
module.exports = {
mode: prod ? 'production' : 'development',
output: {
path: path.resolve('wwwroot'),
publicPath: '',
},
module: {
rules: [
{
test: /\.svelte$/,
use: {
loader: 'svelte-loader',
options: {
compilerOptions: {
dev: !prod
},
emitCss: prod,
}
}
},
{
// required to prevent errors from Svelte on Webpack 5+
test: /node_modules\/svelte\/.*\.mjs$/,
resolve: {
fullySpecified: false
}
}
]
},
resolve: {
extensions: ['.mjs', '.js', '.svelte'],
mainFields: ['browser', 'module', 'main'],
// modules: [path.resolve('.')],
symlinks: false, // https://webpack.js.org/guides/build-performance/#resolving
fallback: {
// cypress preprocessor requires 'path', so we need to tell webpack how to polyfill it
// seems to work without installing path-browserify, so just doing `false` here.
// Tests seem super slow to start, like it's building the whole fricken project or something. But seems to speed up after running a few
path: false, // require.resolve('path-browserify')
},
},
}