@lynx-js/rspeedy 0.15.0 → 0.15.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -22,6 +22,7 @@ function mergeJsOptions(baseOptions, threadOptions) {
22
22
  return merged.output?.minify?.jsOptions ?? {};
23
23
  }
24
24
  function pluginMinify(options) {
25
+ const keepNames = Boolean(process.env['REACT_DEVTOOL']);
25
26
  const defaultJsOptions = Object.freeze({
26
27
  minimizerOptions: {
27
28
  compress: {
@@ -31,14 +32,22 @@ function pluginMinify(options) {
31
32
  inline: 2,
32
33
  comparisons: false,
33
34
  toplevel: true,
34
- side_effects: false
35
+ side_effects: false,
36
+ ...keepNames ? {
37
+ keep_fnames: true,
38
+ keep_classnames: true
39
+ } : {}
35
40
  },
36
41
  format: {
37
42
  keep_quoted_props: true,
38
43
  comments: false
39
44
  },
40
45
  mangle: {
41
- toplevel: true
46
+ toplevel: true,
47
+ ...keepNames ? {
48
+ keep_fnames: true,
49
+ keep_classnames: true
50
+ } : {}
42
51
  }
43
52
  }
44
53
  });
@@ -1,18 +1,10 @@
1
1
  import { getESVersionTarget } from "./1~getESVersionTarget.js";
2
- function isWeb(environment) {
3
- const environmentName = 'string' == typeof environment ? environment : environment.name;
4
- return 'web' === environmentName || environmentName.startsWith('web-');
5
- }
6
2
  function pluginTarget() {
7
3
  return {
8
4
  name: 'lynx:rsbuild:target',
9
5
  setup (api) {
10
- api.modifyBundlerChain((options, { environment })=>{
11
- if (isWeb(environment)) options.target([
12
- getESVersionTarget(),
13
- 'web'
14
- ]);
15
- else options.target([
6
+ api.modifyBundlerChain((options)=>{
7
+ options.target([
16
8
  getESVersionTarget()
17
9
  ]);
18
10
  });