-
-
Notifications
You must be signed in to change notification settings - Fork 3
/
webpack.rules.js
52 lines (52 loc) · 1.07 KB
/
webpack.rules.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
module.exports = [
// Add support for native node modules
{
test: /native_modules\/.+\.node$/,
loader: 'node-loader'
},
{
test: /\.(m?js|node)$/,
parser: { amd: false },
use: {
loader: '@vercel/webpack-asset-relocator-loader',
options: {
outputAssetBase: 'native_modules'
}
}
},
{
test: /\.vue$/,
loader: 'vue-loader'
},
{
test: /\.css$/,
use: [
'style-loader',
'css-loader'
]
},
{
// Most assets can simply be copied over into the output directory:
// * png|jpe?g|svg|gif: Images
// * woff2?|eot|ttf|otf: Fonts
// * ogg|mp3|wav: Audio files
test: /\.(png|jpe?g|gif|woff2?|eot|ttf|otf|ogg|mp3|wav)$/,
type: 'asset/resource'
},
{
test: /\.svg$/,
// SVGs work better inlined
type: 'asset/source'
},
{
test: /(.ts|.tsx)$/,
exclude: /(node_modules|\.webpack)/,
use: {
loader: 'ts-loader',
options: {
transpileOnly: true,
appendTsSuffixTo: [/\.vue$/] // Enable ts support in Vue SFCs
}
}
}
]