@rsbuild/plugin-svelte 1.0.0-alpha.1 → 1.0.0-alpha.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 +13 -14
- package/dist/index.js +13 -14
- package/package.json +5 -6
package/dist/index.cjs
CHANGED
|
@@ -36,7 +36,6 @@ __export(src_exports, {
|
|
|
36
36
|
module.exports = __toCommonJS(src_exports);
|
|
37
37
|
var import_node_path = __toESM(require("path"));
|
|
38
38
|
var import_core = require("@rsbuild/core");
|
|
39
|
-
var import_shared = require("@rsbuild/shared");
|
|
40
39
|
var PLUGIN_SVELTE_NAME = "rsbuild:svelte";
|
|
41
40
|
function pluginSvelte(options = {}) {
|
|
42
41
|
return {
|
|
@@ -76,19 +75,19 @@ function pluginSvelte(options = {}) {
|
|
|
76
75
|
}
|
|
77
76
|
}
|
|
78
77
|
});
|
|
79
|
-
const
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
78
|
+
const userLoaderOptions = options.svelteLoaderOptions ?? {};
|
|
79
|
+
const svelteLoaderOptions = {
|
|
80
|
+
preprocess: sveltePreprocess(options.preprocessOptions),
|
|
81
|
+
// NOTE emitCss: true is currently not supported with HMR
|
|
82
|
+
// See https://github.com/web-infra-dev/rsbuild/issues/2744
|
|
83
|
+
emitCss: isProd && !environmentConfig.output.injectStyles,
|
|
84
|
+
hotReload: isDev && environmentConfig.dev.hmr,
|
|
85
|
+
...userLoaderOptions,
|
|
86
|
+
compilerOptions: {
|
|
87
|
+
dev: isDev,
|
|
88
|
+
...userLoaderOptions.compilerOptions
|
|
89
|
+
}
|
|
90
|
+
};
|
|
92
91
|
chain.module.rule(CHAIN_ID.RULE.SVELTE).test(/\.svelte$/).use(CHAIN_ID.USE.SVELTE).loader(loaderPath).options(svelteLoaderOptions);
|
|
93
92
|
}
|
|
94
93
|
);
|
package/dist/index.js
CHANGED
|
@@ -16,7 +16,6 @@ import path from "path";
|
|
|
16
16
|
// src/index.ts
|
|
17
17
|
import path2 from "path";
|
|
18
18
|
import { logger } from "@rsbuild/core";
|
|
19
|
-
import { deepmerge } from "@rsbuild/shared";
|
|
20
19
|
var PLUGIN_SVELTE_NAME = "rsbuild:svelte";
|
|
21
20
|
function pluginSvelte(options = {}) {
|
|
22
21
|
return {
|
|
@@ -56,19 +55,19 @@ function pluginSvelte(options = {}) {
|
|
|
56
55
|
}
|
|
57
56
|
}
|
|
58
57
|
});
|
|
59
|
-
const
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
58
|
+
const userLoaderOptions = options.svelteLoaderOptions ?? {};
|
|
59
|
+
const svelteLoaderOptions = {
|
|
60
|
+
preprocess: sveltePreprocess(options.preprocessOptions),
|
|
61
|
+
// NOTE emitCss: true is currently not supported with HMR
|
|
62
|
+
// See https://github.com/web-infra-dev/rsbuild/issues/2744
|
|
63
|
+
emitCss: isProd && !environmentConfig.output.injectStyles,
|
|
64
|
+
hotReload: isDev && environmentConfig.dev.hmr,
|
|
65
|
+
...userLoaderOptions,
|
|
66
|
+
compilerOptions: {
|
|
67
|
+
dev: isDev,
|
|
68
|
+
...userLoaderOptions.compilerOptions
|
|
69
|
+
}
|
|
70
|
+
};
|
|
72
71
|
chain.module.rule(CHAIN_ID.RULE.SVELTE).test(/\.svelte$/).use(CHAIN_ID.USE.SVELTE).loader(loaderPath).options(svelteLoaderOptions);
|
|
73
72
|
}
|
|
74
73
|
);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rsbuild/plugin-svelte",
|
|
3
|
-
"version": "1.0.0-alpha.
|
|
3
|
+
"version": "1.0.0-alpha.3",
|
|
4
4
|
"description": "Svelte plugin for Rsbuild",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -23,18 +23,17 @@
|
|
|
23
23
|
],
|
|
24
24
|
"dependencies": {
|
|
25
25
|
"svelte-loader": "3.2.3",
|
|
26
|
-
"svelte-preprocess": "^6.0.1"
|
|
27
|
-
"@rsbuild/shared": "1.0.0-alpha.1"
|
|
26
|
+
"svelte-preprocess": "^6.0.1"
|
|
28
27
|
},
|
|
29
28
|
"devDependencies": {
|
|
30
29
|
"@types/node": "18.x",
|
|
31
30
|
"svelte": "^4.2.18",
|
|
32
31
|
"typescript": "^5.5.2",
|
|
33
|
-
"@rsbuild/core": "1.0.0-alpha.
|
|
34
|
-
"@scripts/test-helper": "1.0.0-alpha.
|
|
32
|
+
"@rsbuild/core": "1.0.0-alpha.3",
|
|
33
|
+
"@scripts/test-helper": "1.0.0-alpha.3"
|
|
35
34
|
},
|
|
36
35
|
"peerDependencies": {
|
|
37
|
-
"@rsbuild/core": "^1.0.0-alpha.
|
|
36
|
+
"@rsbuild/core": "^1.0.0-alpha.3"
|
|
38
37
|
},
|
|
39
38
|
"publishConfig": {
|
|
40
39
|
"access": "public",
|