@rsbuild/core 0.6.2 → 0.6.3

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.
@@ -39,7 +39,7 @@ const applyServerOptions = (command) => {
39
39
  command.option("-o --open [url]", "open the page in browser on startup").option("--port <port>", "specify a port number for server to listen").option("--host <host>", "specify the host that the server listens to");
40
40
  };
41
41
  function runCli() {
42
- import_commander.program.name("rsbuild").usage("<command> [options]").version("0.6.2");
42
+ import_commander.program.name("rsbuild").usage("<command> [options]").version("0.6.3");
43
43
  const devCommand = import_commander.program.command("dev");
44
44
  const buildCommand = import_commander.program.command("build");
45
45
  const previewCommand = import_commander.program.command("preview");
@@ -34,7 +34,7 @@ function prepareCli() {
34
34
  if (!npm_execpath || npm_execpath.includes("npx-cli.js") || npm_execpath.includes(".bun")) {
35
35
  console.log();
36
36
  }
37
- import_rslog.logger.greet(` ${`Rsbuild v${"0.6.2"}`}
37
+ import_rslog.logger.greet(` ${`Rsbuild v${"0.6.3"}`}
38
38
  `);
39
39
  }
40
40
  // Annotate the CommonJS export names for ESM import in node:
package/dist/config.js CHANGED
@@ -160,8 +160,8 @@ function getDefaultEntry(root) {
160
160
  "js",
161
161
  "tsx",
162
162
  "jsx",
163
- ".mjs",
164
- ".cjs"
163
+ "mjs",
164
+ "cjs"
165
165
  ].map((ext) => (0, import_node_path.join)(root, `src/index.${ext}`));
166
166
  const entryFile = (0, import_shared.findExists)(files);
167
167
  if (entryFile) {
package/dist/index.js CHANGED
@@ -38,7 +38,7 @@ var import_config = require("./config");
38
38
  var import_shared = require("@rsbuild/shared");
39
39
  var import_mergeConfig = require("./mergeConfig");
40
40
  var import_constants = require("./constants");
41
- const version = "0.6.2";
41
+ const version = "0.6.3";
42
42
  // Annotate the CommonJS export names for ESM import in node:
43
43
  0 && (module.exports = {
44
44
  PLUGIN_CSS_NAME,
@@ -3,7 +3,6 @@ var __defProp = Object.defineProperty;
3
3
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
4
  var __getOwnPropNames = Object.getOwnPropertyNames;
5
5
  var __hasOwnProp = Object.prototype.hasOwnProperty;
6
- var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
7
6
  var __export = (target, all) => {
8
7
  for (var name in all)
9
8
  __defProp(target, name, { get: all[name], enumerable: true });
@@ -17,48 +16,18 @@ var __copyProps = (to, from, except, desc) => {
17
16
  return to;
18
17
  };
19
18
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
20
- var __publicField = (obj, key, value) => {
21
- __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
22
- return value;
23
- };
24
19
  var moment_exports = {};
25
20
  __export(moment_exports, {
26
21
  pluginMoment: () => pluginMoment
27
22
  });
28
23
  module.exports = __toCommonJS(moment_exports);
29
- class IgnorePlugin {
30
- constructor(options) {
31
- __publicField(this, "options");
32
- this.options = options;
33
- this.checkIgnore = this.checkIgnore.bind(this);
34
- }
35
- checkIgnore(resolveData) {
36
- if ("resourceRegExp" in this.options && this.options.resourceRegExp && this.options.resourceRegExp.test(resolveData.request)) {
37
- if ("contextRegExp" in this.options && this.options.contextRegExp) {
38
- if (this.options.contextRegExp.test(resolveData.context)) {
39
- return false;
40
- }
41
- } else {
42
- return false;
43
- }
44
- }
45
- }
46
- apply(compiler) {
47
- compiler.hooks.normalModuleFactory.tap("IgnorePlugin", (nmf) => {
48
- nmf.hooks.beforeResolve.tap("IgnorePlugin", this.checkIgnore);
49
- });
50
- compiler.hooks.contextModuleFactory.tap("IgnorePlugin", (cmf) => {
51
- cmf.hooks.beforeResolve.tap("IgnorePlugin", this.checkIgnore);
52
- });
53
- }
54
- }
55
24
  const pluginMoment = () => ({
56
25
  name: "rsbuild:moment",
57
26
  setup(api) {
58
- api.modifyBundlerChain(async (chain) => {
27
+ api.modifyBundlerChain(async (chain, { bundler }) => {
59
28
  const config = api.getNormalizedConfig();
60
29
  if (config.performance.removeMomentLocale) {
61
- chain.plugin("remove-moment-locale").use(IgnorePlugin, [
30
+ chain.plugin("remove-moment-locale").use(bundler.IgnorePlugin, [
62
31
  {
63
32
  resourceRegExp: /^\.\/locale$/,
64
33
  contextRegExp: /moment$/
@@ -44,7 +44,7 @@ async function createContextByConfig(options, bundlerType, config = {}) {
44
44
  const context = {
45
45
  entry: (0, import_entry.getEntryObject)(config, "web"),
46
46
  targets: config.output?.targets || [],
47
- version: "0.6.2",
47
+ version: "0.6.3",
48
48
  rootPath,
49
49
  distPath,
50
50
  cachePath,
@@ -108,7 +108,7 @@ function getPluginAPI({
108
108
  applyTransformPlugin(chain, transformer);
109
109
  });
110
110
  };
111
- (0, import_shared.onExitProcess)(() => {
111
+ process.on("exit", () => {
112
112
  hooks.onExit.call();
113
113
  });
114
114
  return {
@@ -115,6 +115,7 @@ async function generateRspackConfig({
115
115
  const {
116
116
  BannerPlugin,
117
117
  DefinePlugin,
118
+ IgnorePlugin,
118
119
  ProvidePlugin,
119
120
  HotModuleReplacementPlugin
120
121
  } = await Promise.resolve().then(() => __toESM(require("@rspack/core")));
@@ -123,6 +124,7 @@ async function generateRspackConfig({
123
124
  bundler: {
124
125
  BannerPlugin,
125
126
  DefinePlugin,
127
+ IgnorePlugin,
126
128
  ProvidePlugin,
127
129
  HotModuleReplacementPlugin
128
130
  }
@@ -1,6 +1,6 @@
1
1
  import { isMultiCompiler, type Stats, type MultiStats, type StatsError } from '@rsbuild/shared';
2
2
  import type { StatsCompilation, StatsValue } from '@rspack/core';
3
- export declare const rspackMinVersion = "0.6.0";
3
+ export declare const rspackMinVersion = "0.6.2";
4
4
  export declare const isSatisfyRspackVersion: (originalVersion: string) => Promise<boolean>;
5
5
  export declare const getCompiledPath: (packageName: string) => string;
6
6
  export declare const BUILTIN_LOADER = "builtin:";
@@ -32,7 +32,7 @@ var import_node_path = require("node:path");
32
32
  var import_shared = require("@rsbuild/shared");
33
33
  var import_shared2 = require("@rsbuild/shared");
34
34
  var import_formatStats = require("../client/formatStats");
35
- const rspackMinVersion = "0.6.0";
35
+ const rspackMinVersion = "0.6.2";
36
36
  const compareSemver = (version1, version2) => {
37
37
  const parts1 = version1.split(".").map(Number);
38
38
  const parts2 = version2.split(".").map(Number);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rsbuild/core",
3
- "version": "0.6.2",
3
+ "version": "0.6.3",
4
4
  "description": "The Rspack-based build tool.",
5
5
  "homepage": "https://rsbuild.dev",
6
6
  "bugs": {
@@ -48,12 +48,12 @@
48
48
  "types.d.ts"
49
49
  ],
50
50
  "dependencies": {
51
- "@rspack/core": "0.6.1",
51
+ "@rspack/core": "0.6.2",
52
52
  "@swc/helpers": "0.5.3",
53
53
  "core-js": "~3.36.0",
54
54
  "html-webpack-plugin": "npm:html-rspack-plugin@5.6.2",
55
55
  "postcss": "^8.4.38",
56
- "@rsbuild/shared": "0.6.2"
56
+ "@rsbuild/shared": "0.6.3"
57
57
  },
58
58
  "devDependencies": {
59
59
  "@types/node": "16.x",