@rsbuild/plugin-svelte 0.3.7 → 0.3.9

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.js CHANGED
@@ -55,7 +55,7 @@ function pluginSvelte(options = {}) {
55
55
  cause: err
56
56
  });
57
57
  }
58
- api.modifyBundlerChain(async (chain, { CHAIN_ID, isProd }) => {
58
+ api.modifyBundlerChain(async (chain, { CHAIN_ID, isDev }) => {
59
59
  const { default: sveltePreprocess } = await import("svelte-preprocess");
60
60
  const rsbuildConfig = api.getNormalizedConfig();
61
61
  chain.resolve.alias.set("svelte", import_node_path.default.join(sveltePath, "src/runtime"));
@@ -73,11 +73,11 @@ function pluginSvelte(options = {}) {
73
73
  const svelteLoaderOptions = (0, import_shared.deepmerge)(
74
74
  {
75
75
  compilerOptions: {
76
- dev: !isProd
76
+ dev: isDev
77
77
  },
78
78
  preprocess: sveltePreprocess(options.preprocessOptions),
79
79
  emitCss: !rsbuildConfig.output.injectStyles,
80
- hotReload: !isProd && rsbuildConfig.dev.hmr
80
+ hotReload: isDev && rsbuildConfig.dev.hmr
81
81
  },
82
82
  options.svelteLoaderOptions ?? {}
83
83
  );
package/dist/index.mjs CHANGED
@@ -36,7 +36,7 @@ function pluginSvelte(options = {}) {
36
36
  cause: err
37
37
  });
38
38
  }
39
- api.modifyBundlerChain(async (chain, { CHAIN_ID, isProd }) => {
39
+ api.modifyBundlerChain(async (chain, { CHAIN_ID, isDev }) => {
40
40
  const { default: sveltePreprocess } = await import("svelte-preprocess");
41
41
  const rsbuildConfig = api.getNormalizedConfig();
42
42
  chain.resolve.alias.set("svelte", path2.join(sveltePath, "src/runtime"));
@@ -54,11 +54,11 @@ function pluginSvelte(options = {}) {
54
54
  const svelteLoaderOptions = deepmerge(
55
55
  {
56
56
  compilerOptions: {
57
- dev: !isProd
57
+ dev: isDev
58
58
  },
59
59
  preprocess: sveltePreprocess(options.preprocessOptions),
60
60
  emitCss: !rsbuildConfig.output.injectStyles,
61
- hotReload: !isProd && rsbuildConfig.dev.hmr
61
+ hotReload: isDev && rsbuildConfig.dev.hmr
62
62
  },
63
63
  options.svelteLoaderOptions ?? {}
64
64
  );
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rsbuild/plugin-svelte",
3
- "version": "0.3.7",
3
+ "version": "0.3.9",
4
4
  "description": "Svelte plugin for Rsbuild",
5
5
  "repository": {
6
6
  "type": "git",
@@ -24,17 +24,17 @@
24
24
  "dependencies": {
25
25
  "svelte-loader": "3.1.9",
26
26
  "svelte-preprocess": "^5.0.4",
27
- "@rsbuild/shared": "0.3.7"
27
+ "@rsbuild/shared": "0.3.9"
28
28
  },
29
29
  "devDependencies": {
30
30
  "@types/node": "16.x",
31
31
  "svelte": "^4.2.2",
32
32
  "typescript": "^5.3.0",
33
- "@rsbuild/core": "0.3.7",
34
- "@scripts/test-helper": "0.3.7"
33
+ "@rsbuild/core": "0.3.9",
34
+ "@scripts/test-helper": "0.3.9"
35
35
  },
36
36
  "peerDependencies": {
37
- "@rsbuild/core": "^0.3.7"
37
+ "@rsbuild/core": "^0.3.9"
38
38
  },
39
39
  "publishConfig": {
40
40
  "access": "public",