-
Notifications
You must be signed in to change notification settings - Fork 23
/
vue.config.js
32 lines (31 loc) · 1.01 KB
/
vue.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
const webpack = require('webpack');
module.exports = {
lintOnSave: false,
configureWebpack: (config) => {
config.module.rules = config.module.rules.map((rule) => {
if (rule.oneOf instanceof Array) {
return {
...rule,
oneOf: [{ test: /\.wasm$/, type: 'webassembly/async' }, ...rule.oneOf],
};
}
return rule;
});
const fallback = config.resolve.fallback || {};
Object.assign(fallback, {
fs: false,
buffer: require.resolve('buffer'),
path: require.resolve('path-browserify'),
stream: require.resolve('stream-browserify'),
});
config.resolve.fallback = fallback;
config.plugins = (config.plugins || []).concat([
new webpack.ProvidePlugin({
Buffer: ['buffer', 'Buffer'],
}),
]);
config.experiments = {
asyncWebAssembly: true,
};
},
};