-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsnowpack.config.js
65 lines (63 loc) · 1.53 KB
/
snowpack.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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
/** @type {import("snowpack").SnowpackUserConfig } */
module.exports = {
mount: {
public: { url: '/', static: true },
src: { url: '/dist' },
},
plugins: [
[
'@snowpack/plugin-webpack',
{
extendConfig: (config) => {
// FIXES https://github.com/snowpackjs/snowpack/discussions/2810
config.module.rules.find(
(rule) =>
rule &&
rule.use &&
rule.use.find((use) => {
if (
!use ||
!use.loader ||
!use.loader.includes('babel-loader')
) {
return null;
}
use.options.plugins = (use.options.plugins || []).concat([
'@babel/plugin-proposal-optional-chaining', '@babel/plugin-proposal-nullish-coalescing-operator'
]);
return use;
}),
);
return config;
},
},
],
'@snowpack/plugin-postcss',
'@snowpack/plugin-react-refresh',
'@snowpack/plugin-dotenv',
'@snowpack/plugin-typescript',
'snowpack-svgr-plugin',
],
routes: [
/* Enable an SPA Fallback in development: */
{ "match": "routes", "src": ".*", "dest": "/index.html" },
],
optimize: {
/* Example: Bundle your final build: */
// "bundle": true,
},
packageOptions: {
/* ... */
},
devOptions: {
hmr: false,
port: 2000,
/* ... */
},
buildOptions: {
/* ... */
},
alias: {
"~": "./src",
}
};