-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsnowpack.config.js
71 lines (67 loc) · 1.18 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
66
67
68
69
70
71
/** @type {import("snowpack").SnowpackUserConfig } */
/* eslint-disable */
module.exports = {
mount: {
public: '/',
src: '/_dist_',
},
plugins: [
'@snowpack/plugin-react-refresh',
'@snowpack/plugin-dotenv',
'@snowpack/plugin-typescript',
'@snowpack/plugin-sass',
[
'@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',
]);
return use;
}),
);
return config;
},
},
],
],
packageOptions: {
/* ... */
sourcemap :true,
polyfillNode:true,
namedExports:[
'draft-js',
'moo',
'antlr4ts'
],
rollup: {
plugins: [
require('rollup-plugin-node-polyfills')()
]
}
},
devOptions: {
/* ... */
port:3000
},
buildOptions: {
/* ... */
sourcemap:true
},
alias: {
/* ... */
},
};