-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathvue.config.js
65 lines (60 loc) · 1.91 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
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
const { defineConfig } = require('@vue/cli-service')
const MonacoEditorPlugin = require('monaco-editor-webpack-plugin')
module.exports = defineConfig({
transpileDependencies: true
})
module.exports = defineConfig({
transpileDependencies: true,
configureWebpack: config => {
config.plugins.push(
new MonacoEditorPlugin({
// https://github.com/Microsoft/monaco-editor-webpack-plugin#options
// Include a subset of languages support
// Some language extensions like typescript are so huge that may impact build performance
// e.g. Build full languages support with webpack 4.0 takes over 80 seconds
// Languages are loaded on demand at runtime
languages: ['javascript', 'css', 'html', 'typescript']
})
)
for (const rule of config.module.rules) {
rule.resourceQuery = {
not: [/assembly/]
}
}
config.module.rules.unshift(
{
test: /\.ts/,
resourceQuery: /assembly/,
type: 'asset/source'
}
)
config.module.rules.unshift(
{
test: /\.as/,
resourceQuery: /assembly/,
type: 'asset/source'
}
)
config.module.rules.unshift(
{
test: /\.txt/,
resourceQuery: /assembly/,
type: 'asset/source'
}
)
config.resolve.fallback = {
path: require.resolve('assemblyscript/util/browser/path.js'),
url: require.resolve("assemblyscript/util/browser/url.js"),
fs: require.resolve("assemblyscript/util/browser/fs.js"),
module: require.resolve("assemblyscript/util/browser/module.js"),
util: require.resolve("util/"),
buffer: require.resolve('buffer-browserify'),
process: require.resolve('assemblyscript/util/browser/process.js'),
stream: require.resolve('stream-browserify'),
}
if (!config.experiments) {
config.experiments = {}
}
config.experiments.topLevelAwait = true
}
})