-
Notifications
You must be signed in to change notification settings - Fork 32
/
Copy pathrsbuild.config.ts
56 lines (54 loc) · 1.49 KB
/
rsbuild.config.ts
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
import { defineConfig } from '@rsbuild/core';
import { pluginNodePolyfill } from '@rsbuild/plugin-node-polyfill';
import { version } from './package.json';
// eslint-disable-next-line import/no-default-export
export default defineConfig({
source: {
entry: {
Apify: './src/index.ts',
},
define: {
VERSION: JSON.stringify(version),
BROWSER_BUILD: true,
},
},
output: {
distPath: { js: '.' },
filename: { js: 'bundle.js' },
// filename: { js: '[name].js' },
target: 'web',
cleanDistPath: false,
sourceMap: true,
minify: {
jsOptions: {
minimizerOptions: {
mangle: false,
},
},
},
},
tools: {
htmlPlugin: false,
rspack(config) {
config.output = {
...config.output,
library: {
type: 'umd', // or 'umd', 'commonjs', etc.
name: 'Apify',
},
globalObject: 'this',
};
config.optimization = {
...config.optimization,
providedExports: false,
usedExports: false,
splitChunks: false,
minimize: false,
};
config.devtool = 'source-map';
},
},
// mode: 'production',
mode: 'development',
plugins: [pluginNodePolyfill()],
});