forked from TheRealSimon42/simon42-dashboard-strategy
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwebpack.dev.config.cjs
More file actions
44 lines (39 loc) · 957 Bytes
/
Copy pathwebpack.dev.config.cjs
File metadata and controls
44 lines (39 loc) · 957 Bytes
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
// Webpack 5 development build — single-bundle, source-maps inline,
// no chunk-splitting (LimitChunkCountPlugin) so the loader picks up
// every change in one file under `dist/`.
'use strict';
// Node 18 fallback — see webpack.config.cjs for context.
if (!globalThis.crypto) {
globalThis.crypto = require('crypto').webcrypto;
}
const path = require('path');
const webpack = require('webpack');
/** @type {import('webpack').Configuration} */
const config = {
mode: 'development',
devtool: 'source-map',
entry: './src/oriel.ts',
output: {
clean: true,
filename: 'oriel.js',
path: path.resolve(__dirname, 'dist'),
},
resolve: {
extensions: ['.ts', '.js'],
},
module: {
rules: [
{
test: /\.ts$/,
use: 'ts-loader',
exclude: /node_modules/,
},
],
},
plugins: [
new webpack.optimize.LimitChunkCountPlugin({
maxChunks: 1,
}),
],
};
module.exports = config;