-
Notifications
You must be signed in to change notification settings - Fork 682
Expand file tree
/
Copy pathrspack.dev.config.mjs
More file actions
45 lines (41 loc) · 1.1 KB
/
rspack.dev.config.mjs
File metadata and controls
45 lines (41 loc) · 1.1 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
// @ts-check
/** @typedef {import('@rushstack/heft-rspack-plugin').IRspackConfiguration} IRspackConfiguration */
'use strict';
import { dirname, resolve } from 'node:path';
import { fileURLToPath } from 'node:url';
import { HtmlRspackPlugin } from '@rspack/core';
const __filename = fileURLToPath(import.meta.url);
const __dirname = dirname(__filename);
/** @type {IRspackConfiguration} */
const config = {
mode: 'none',
module: {
rules: [
{
test: /\.png$/i,
type: 'asset/resource'
}
]
},
target: ['web', 'es2020'],
resolve: {
extensions: ['.js', '.json']
},
entry: {
'heft-test-A': resolve(__dirname, 'lib-commonjs', 'indexA.js'),
'heft-test-B': resolve(__dirname, 'lib-commonjs', 'indexB.js')
},
output: {
path: resolve(__dirname, 'dist'),
filename: '[name]_[contenthash].js',
chunkFilename: '[id].[name]_[contenthash].js',
assetModuleFilename: '[name]_[contenthash][ext][query]'
},
devtool: 'source-map',
optimization: {
minimize: false,
minimizer: []
},
plugins: [new HtmlRspackPlugin()]
};
export default config;