-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwebpack.dev.js
More file actions
executable file
·48 lines (47 loc) · 1.61 KB
/
Copy pathwebpack.dev.js
File metadata and controls
executable file
·48 lines (47 loc) · 1.61 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
const path = require('path');
const HtmlWebpackPlugin = require('html-webpack-plugin');
const MonacoEditorWebpackPlugin = require('monaco-editor-webpack-plugin');
const ForkTsCheckerWebpackPlugin = require('fork-ts-checker-webpack-plugin');
module.exports = {
mode: 'development',
entry: './src/index.ts',
output: {
filename: 'bundle.js',
path: path.resolve(__dirname, 'dist'),
publicPath: '/',
clean: true
},
devtool: 'source-map',
cache: { type: 'filesystem' },
resolve: { extensions: ['.ts', '.js', '.mjs'] },
module: {
rules: [
{ test: /\.html$/i, loader: 'html-loader' },
{
test: /\.tsx?$/,
exclude: /node_modules/,
use: { loader: 'esbuild-loader', options: { loader: 'ts', target: 'es2020' } }
},
{ test: /\.css$/, use: ['style-loader', 'css-loader'] },
{ test: /\.(png|svg|jpg|jpeg|gif|woff|woff2|eot|ttf|otf)$/i, type: 'asset/resource' },
{ test: /\.mjs$/, include: /node_modules/, type: 'javascript/auto' }
]
},
plugins: [
new HtmlWebpackPlugin({ template: './src/index.html', favicon: './src/assets/favicon.ico' }),
new MonacoEditorWebpackPlugin({
languages: ['typescript', 'javascript', 'json', 'css', 'html', 'markdown']
}),
new ForkTsCheckerWebpackPlugin()
],
devServer: {
static: false,
hot: true,
port: 9000,
open: false,
client: { overlay: true },
devMiddleware: { writeToDisk: false },
watchFiles: { paths: ['src/**/*'], options: { usePolling: true, interval: 200, ignored: /node_modules/ } }
},
stats: 'minimal'
};