@rsbuild/plugin-svelte 1.0.2 → 1.0.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.
package/dist/index.cjs CHANGED
@@ -3,7 +3,7 @@
3
3
  var __webpack_require__ = {};
4
4
  /************************************************************************/ // webpack/runtime/compat_get_default_export
5
5
  (()=>{
6
- // getDefaultExport function for compatibility with non-harmony modules
6
+ // getDefaultExport function for compatibility with non-ESM modules
7
7
  __webpack_require__.n = function(module) {
8
8
  var getter = module && module.__esModule ? function() {
9
9
  return module['default'];
@@ -67,8 +67,7 @@ const isSvelte5 = async (sveltePath)=>{
67
67
  return false;
68
68
  }
69
69
  };
70
- function pluginSvelte() {
71
- let options = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {};
70
+ function pluginSvelte(options = {}) {
72
71
  return {
73
72
  name: PLUGIN_SVELTE_NAME,
74
73
  setup (api) {
@@ -86,8 +85,7 @@ function pluginSvelte() {
86
85
  cause: err
87
86
  });
88
87
  }
89
- api.modifyBundlerChain(async (chain, param)=>{
90
- let { CHAIN_ID, environment, isDev, isProd } = param;
88
+ api.modifyBundlerChain(async (chain, { CHAIN_ID, environment, isDev, isProd })=>{
91
89
  const svelte5 = await isSvelte5(sveltePath);
92
90
  const environmentConfig = environment.config;
93
91
  if (!svelte5) chain.resolve.alias.set('svelte', external_node_path_default().join(sveltePath, 'src/runtime'));
package/dist/index.js CHANGED
@@ -13,8 +13,7 @@ const isSvelte5 = async (sveltePath)=>{
13
13
  return false;
14
14
  }
15
15
  };
16
- function pluginSvelte() {
17
- let options = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {};
16
+ function pluginSvelte(options = {}) {
18
17
  return {
19
18
  name: PLUGIN_SVELTE_NAME,
20
19
  setup (api) {
@@ -32,8 +31,7 @@ function pluginSvelte() {
32
31
  cause: err
33
32
  });
34
33
  }
35
- api.modifyBundlerChain(async (chain, param)=>{
36
- let { CHAIN_ID, environment, isDev, isProd } = param;
34
+ api.modifyBundlerChain(async (chain, { CHAIN_ID, environment, isDev, isProd })=>{
37
35
  const svelte5 = await isSvelte5(sveltePath);
38
36
  const environmentConfig = environment.config;
39
37
  if (!svelte5) chain.resolve.alias.set('svelte', __WEBPACK_EXTERNAL_MODULE_node_path__["default"].join(sveltePath, 'src/runtime'));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rsbuild/plugin-svelte",
3
- "version": "1.0.2",
3
+ "version": "1.0.3",
4
4
  "description": "Svelte plugin for Rsbuild",
5
5
  "repository": {
6
6
  "type": "git",
@@ -29,11 +29,11 @@
29
29
  "@types/node": "18.x",
30
30
  "svelte": "^4.2.19",
31
31
  "typescript": "^5.6.3",
32
- "@rsbuild/core": "1.0.14",
32
+ "@rsbuild/core": "1.0.19",
33
33
  "@scripts/test-helper": "1.0.1"
34
34
  },
35
35
  "peerDependencies": {
36
- "@rsbuild/core": "1.x || ^1.0.1-rc.0"
36
+ "@rsbuild/core": "1.x"
37
37
  },
38
38
  "publishConfig": {
39
39
  "access": "public",