-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwebpack.config.js
More file actions
107 lines (105 loc) · 5.11 KB
/
Copy pathwebpack.config.js
File metadata and controls
107 lines (105 loc) · 5.11 KB
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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
const path = require('path');
module.exports = {
mode: 'development',
entry: './src/index.js', // This will be overridden by Theia
output: {
path: path.resolve(__dirname, 'dist'),
filename: '[name].bundle.js',
libraryTarget: 'umd'
},
resolve: {
extensions: ['.ts', '.tsx', '.js', '.jsx', '.json'],
modules: [
path.resolve(__dirname, './'), // Look in our root first
'node_modules'
],
alias: {
// Force single versions of Theia packages
'@theia/core': path.resolve(__dirname, 'node_modules/@theia/core'),
'@theia/editor': path.resolve(__dirname, 'node_modules/@theia/editor'),
'@theia/filesystem': path.resolve(__dirname, 'node_modules/@theia/filesystem'),
'@theia/markers': path.resolve(__dirname, 'node_modules/@theia/markers'),
'@theia/messages': path.resolve(__dirname, 'node_modules/@theia/messages'),
'@theia/navigator': path.resolve(__dirname, 'node_modules/@theia/navigator'),
'@theia/preferences': path.resolve(__dirname, 'node_modules/@theia/preferences'),
'@theia/process': path.resolve(__dirname, 'node_modules/@theia/process'),
'@theia/terminal': path.resolve(__dirname, 'node_modules/@theia/terminal'),
'@theia/workspace': path.resolve(__dirname, 'node_modules/@theia/workspace'),
'@theia/monaco': path.resolve(__dirname, 'node_modules/@theia/monaco'),
'@theia/application-package': path.resolve(__dirname, 'node_modules/@theia/application-package'),
'@theia/bulk-edit': path.resolve(__dirname, 'node_modules/@theia/bulk-edit'),
'@theia/callhierarchy': path.resolve(__dirname, 'node_modules/@theia/callhierarchy'),
'@theia/console': path.resolve(__dirname, 'node_modules/@theia/console'),
'@theia/debug': path.resolve(__dirname, 'node_modules/@theia/debug'),
'@theia/editor-preview': path.resolve(__dirname, 'node_modules/@theia/editor-preview'),
'@theia/file-search': path.resolve(__dirname, 'node_modules/@theia/file-search'),
'@theia/notebook': path.resolve(__dirname, 'node_modules/@theia/notebook'),
'@theia/outline-view': path.resolve(__dirname, 'node_modules/@theia/outline-view'),
'@theia/output': path.resolve(__dirname, 'node_modules/@theia/output'),
'@theia/plugin': path.resolve(__dirname, 'node_modules/@theia/plugin'),
'@theia/plugin-ext': path.resolve(__dirname, 'node_modules/@theia/plugin-ext'),
'@theia/request': path.resolve(__dirname, 'node_modules/@theia/request'),
'@theia/scm': path.resolve(__dirname, 'node_modules/@theia/scm'),
'@theia/search-in-workspace': path.resolve(__dirname, 'node_modules/@theia/search-in-workspace'),
'@theia/task': path.resolve(__dirname, 'node_modules/@theia/task'),
'@theia/test': path.resolve(__dirname, 'node_modules/@theia/test'),
'@theia/timeline': path.resolve(__dirname, 'node_modules/@theia/timeline'),
'@theia/typehierarchy': path.resolve(__dirname, 'node_modules/@theia/typehierarchy'),
'@theia/userstorage': path.resolve(__dirname, 'node_modules/@theia/userstorage'),
'@theia/variable-resolver': path.resolve(__dirname, 'node_modules/@theia/variable-resolver'),
'@theia/vsx-registry': path.resolve(__dirname, 'node_modules/@theia/vsx-registry'),
// Force single versions of CodeMirror packages
'@codemirror/state': path.resolve(__dirname, 'node_modules/@codemirror/state'),
'@codemirror/view': path.resolve(__dirname, 'node_modules/@codemirror/view'),
'@codemirror/language': path.resolve(__dirname, 'node_modules/@codemirror/language'),
'@codemirror/commands': path.resolve(__dirname, 'node_modules/@codemirror/commands'),
'@codemirror/search': path.resolve(__dirname, 'node_modules/@codemirror/search'),
'@codemirror/autocomplete': path.resolve(__dirname, 'node_modules/@codemirror/autocomplete'),
'@codemirror/lint': path.resolve(__dirname, 'node_modules/@codemirror/lint'),
'@codemirror/lsp-client': path.resolve(__dirname, 'node_modules/@codemirror/lsp-client'),
// Force single versions of other common packages
'vscode-ws-jsonrpc': path.resolve(__dirname, 'node_modules/vscode-ws-jsonrpc'),
'ws': path.resolve(__dirname, 'node_modules/ws'),
'express-ws': path.resolve(__dirname, 'node_modules/express-ws'),
'markdown-it': path.resolve(__dirname, 'node_modules/markdown-it')
}
},
module: {
rules: [
{
test: /\.tsx?$/,
use: 'ts-loader',
exclude: /node_modules/
},
{
test: /\.css$/,
use: ['style-loader', 'css-loader']
}
]
},
optimization: {
// Ensure only one instance of each module is used
splitChunks: {
chunks: 'all',
cacheGroups: {
vendor: {
test: /[\\/]node_modules[\\/]/,
name: 'vendors',
chunks: 'all',
},
theia: {
test: /[\\/]node_modules[\\/]@theia[\\/]/,
name: 'theia',
chunks: 'all',
priority: 10
},
codemirror: {
test: /[\\/]node_modules[\\/]@codemirror[\\/]/,
name: 'codemirror',
chunks: 'all',
priority: 10
}
}
}
}
};