@modern-js/rsbuild-plugin-esbuild 2.52.0 → 2.54.0

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.
Files changed (2) hide show
  1. package/dist/index.js +4 -3
  2. package/package.json +6 -6
package/dist/index.js CHANGED
@@ -33,6 +33,7 @@ __export(src_exports, {
33
33
  module.exports = __toCommonJS(src_exports);
34
34
  var import_path = __toESM(require("path"));
35
35
  var import_shared = require("@rsbuild/shared");
36
+ const TS_REGEX = /\.(?:ts|mts|cts|tsx)$/;
36
37
  function pluginEsbuild(userOptions = {}) {
37
38
  return {
38
39
  name: "modernjs:esbuild",
@@ -55,12 +56,12 @@ function pluginEsbuild(userOptions = {}) {
55
56
  if (options.loader !== false) {
56
57
  chain.module.rule(CHAIN_ID.RULE.JS).uses.delete(CHAIN_ID.USE.BABEL);
57
58
  chain.module.rule(CHAIN_ID.RULE.TS).uses.delete(CHAIN_ID.USE.BABEL).delete(CHAIN_ID.USE.TS);
58
- chain.module.rule(CHAIN_ID.RULE.JS).test(import_shared.JS_REGEX).use(CHAIN_ID.USE.ESBUILD).loader(esbuildLoaderPath).options({
59
+ chain.module.rule(CHAIN_ID.RULE.JS).test(import_shared.JS_REGEX).use("esbuild").loader(esbuildLoaderPath).options({
59
60
  loader: "jsx",
60
61
  ...options === null || options === void 0 ? void 0 : options.loader
61
62
  });
62
63
  const rule = chain.module.rule(CHAIN_ID.RULE.TS);
63
- rule.test(import_shared.TS_REGEX).use(CHAIN_ID.USE.ESBUILD).loader(esbuildLoaderPath).options({
64
+ rule.test(TS_REGEX).use("esbuild").loader(esbuildLoaderPath).options({
64
65
  loader: "tsx",
65
66
  ...options === null || options === void 0 ? void 0 : options.loader
66
67
  });
@@ -76,7 +77,7 @@ function pluginEsbuild(userOptions = {}) {
76
77
  if (isProd && options.minimize !== false) {
77
78
  const { ESBuildMinifyPlugin } = await Promise.resolve().then(() => __toESM(require("../compiled/esbuild-loader")));
78
79
  chain.optimization.minimizers.delete(CHAIN_ID.MINIMIZER.JS).delete(CHAIN_ID.MINIMIZER.CSS);
79
- chain.optimization.minimizer(CHAIN_ID.MINIMIZER.ESBUILD).use(ESBuildMinifyPlugin).init(() => {
80
+ chain.optimization.minimizer("js-css").use(ESBuildMinifyPlugin).init(() => {
80
81
  var _rsbuildConfig_output;
81
82
  return new ESBuildMinifyPlugin({
82
83
  // other legalComments such as linked is not supported yet
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@modern-js/rsbuild-plugin-esbuild",
3
- "version": "2.52.0",
3
+ "version": "2.54.0",
4
4
  "description": "Esbuild Rsbuild plugin and Modern.js",
5
5
  "homepage": "https://modernjs.dev",
6
6
  "repository": {
@@ -23,15 +23,15 @@
23
23
  ],
24
24
  "dependencies": {
25
25
  "@swc/helpers": "0.5.3",
26
- "@rsbuild/shared": "0.7.3",
26
+ "@rsbuild/shared": "0.7.9",
27
27
  "esbuild": "0.17.19",
28
- "webpack": "^5.91.0"
28
+ "webpack": "^5.92.0"
29
29
  },
30
30
  "devDependencies": {
31
- "@rsbuild/core": "0.7.3",
32
- "@rsbuild/webpack": "0.7.3",
31
+ "@rsbuild/core": "0.7.9",
32
+ "@rsbuild/webpack": "0.7.9",
33
33
  "typescript": "^5.4.2",
34
- "@scripts/build": "2.52.0"
34
+ "@scripts/build": "2.54.0"
35
35
  },
36
36
  "publishConfig": {
37
37
  "access": "public",