forked from TypeFox/monaco-languageclient
-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.config.js
51 lines (48 loc) · 1.63 KB
/
webpack.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
/* --------------------------------------------------------------------------------------------
* Copyright (c) 2024 TypeFox GmbH (http://www.typefox.io). All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
* ------------------------------------------------------------------------------------------ */
// solve: __dirname is not defined in ES module scope
import { fileURLToPath } from 'url';
import { dirname, resolve } from 'path';
const __filename = fileURLToPath(import.meta.url);
const __dirname = dirname(__filename);
const config = {
entry: resolve(__dirname, 'src', 'client', 'main.ts'),
module: {
rules: [{
test: /\.css$/,
use: ['style-loader', 'css-loader']
},
{
test: /\.ts?$/,
use: ['ts-loader']
},
{
test: /\.js$/,
enforce: 'pre',
use: ['source-map-loader'],
// These modules seems to have broken sourcemaps, exclude them to prevent an error flood in the logs
exclude: [/vscode-jsonrpc/, /vscode-languageclient/, /vscode-languageserver/, /vscode-languageserver-protocol/]
},
{
test: /\.(mp3|wasm)$/i,
type: 'asset/resource'
}]
},
experiments: {
outputModule: true
},
output: {
filename: 'main.js',
path: resolve(__dirname, 'dist', 'client'),
module: true
},
target: 'web',
resolve: {
extensions: ['.ts', '.js', '.json', '.ttf']
},
mode: 'development',
devtool: 'source-map'
};
export default config;