storybook-builder-rsbuild 0.0.11 → 0.0.13-beta.1
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 +7 -4
- package/dist/index.mjs +7 -4
- package/package.json +2 -2
- package/templates/preview.ejs +38 -6
package/dist/index.js
CHANGED
@@ -414,6 +414,7 @@ var iframe_rsbuild_config_default = async (options) => {
|
|
414
414
|
const merged = (0, import_core.mergeRsbuildConfig)(contentFromConfig, {
|
415
415
|
output: {
|
416
416
|
cleanDistPath: false,
|
417
|
+
assetPrefix: "/",
|
417
418
|
dataUriLimit: {
|
418
419
|
media: 1e4
|
419
420
|
},
|
@@ -430,11 +431,15 @@ var iframe_rsbuild_config_default = async (options) => {
|
|
430
431
|
font: resourceFilename,
|
431
432
|
media: resourceFilename
|
432
433
|
},
|
433
|
-
assetPrefix: "/",
|
434
434
|
externals
|
435
435
|
},
|
436
|
+
server: {
|
437
|
+
// Storybook will handle public directory itself, disable Rsbuild's public dir
|
438
|
+
// feature to prevent overwriting Storybook's public directory.
|
439
|
+
publicDir: false
|
440
|
+
},
|
436
441
|
dev: {
|
437
|
-
assetPrefix: "",
|
442
|
+
assetPrefix: "/",
|
438
443
|
progressBar: !quiet
|
439
444
|
},
|
440
445
|
source: {
|
@@ -489,8 +494,6 @@ var iframe_rsbuild_config_default = async (options) => {
|
|
489
494
|
config.watchOptions = {
|
490
495
|
ignored: /node_modules/
|
491
496
|
};
|
492
|
-
config.output = config.output || {};
|
493
|
-
config.output.publicPath = "";
|
494
497
|
config.ignoreWarnings = [
|
495
498
|
...config.ignoreWarnings || [],
|
496
499
|
/export '\S+' was not found in 'global'/,
|
package/dist/index.mjs
CHANGED
@@ -357,6 +357,7 @@ var iframe_rsbuild_config_default = async (options) => {
|
|
357
357
|
const merged = mergeRsbuildConfig(contentFromConfig, {
|
358
358
|
output: {
|
359
359
|
cleanDistPath: false,
|
360
|
+
assetPrefix: "/",
|
360
361
|
dataUriLimit: {
|
361
362
|
media: 1e4
|
362
363
|
},
|
@@ -373,11 +374,15 @@ var iframe_rsbuild_config_default = async (options) => {
|
|
373
374
|
font: resourceFilename,
|
374
375
|
media: resourceFilename
|
375
376
|
},
|
376
|
-
assetPrefix: "/",
|
377
377
|
externals
|
378
378
|
},
|
379
|
+
server: {
|
380
|
+
// Storybook will handle public directory itself, disable Rsbuild's public dir
|
381
|
+
// feature to prevent overwriting Storybook's public directory.
|
382
|
+
publicDir: false
|
383
|
+
},
|
379
384
|
dev: {
|
380
|
-
assetPrefix: "",
|
385
|
+
assetPrefix: "/",
|
381
386
|
progressBar: !quiet
|
382
387
|
},
|
383
388
|
source: {
|
@@ -434,8 +439,6 @@ var iframe_rsbuild_config_default = async (options) => {
|
|
434
439
|
config.watchOptions = {
|
435
440
|
ignored: /node_modules/
|
436
441
|
};
|
437
|
-
config.output = config.output || {};
|
438
|
-
config.output.publicPath = "";
|
439
442
|
config.ignoreWarnings = [
|
440
443
|
...config.ignoreWarnings || [],
|
441
444
|
/export '\S+' was not found in 'global'/,
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "storybook-builder-rsbuild",
|
3
|
-
"version": "0.0.
|
3
|
+
"version": "0.0.13-beta.1",
|
4
4
|
"description": "Rsbuild builder for Storybook",
|
5
5
|
"keywords": [
|
6
6
|
"storybook",
|
@@ -86,7 +86,7 @@
|
|
86
86
|
"add": "^2.0.6",
|
87
87
|
"pretty-hrtime": "^1.0.3",
|
88
88
|
"slash": "^5.0.0",
|
89
|
-
"storybook": "8.2.
|
89
|
+
"storybook": "8.2.8",
|
90
90
|
"typescript": "^5.3.2"
|
91
91
|
},
|
92
92
|
"peerDependencies": {
|
package/templates/preview.ejs
CHANGED
@@ -10,11 +10,39 @@
|
|
10
10
|
|
11
11
|
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
12
12
|
|
13
|
-
<
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
13
|
+
<style>
|
14
|
+
@font-face {
|
15
|
+
font-family: 'Nunito Sans';
|
16
|
+
font-style: normal;
|
17
|
+
font-weight: 400;
|
18
|
+
font-display: swap;
|
19
|
+
src: url('./sb-common-assets/nunito-sans-regular.woff2') format('woff2');
|
20
|
+
}
|
21
|
+
|
22
|
+
@font-face {
|
23
|
+
font-family: 'Nunito Sans';
|
24
|
+
font-style: italic;
|
25
|
+
font-weight: 400;
|
26
|
+
font-display: swap;
|
27
|
+
src: url('./sb-common-assets/nunito-sans-italic.woff2') format('woff2');
|
28
|
+
}
|
29
|
+
|
30
|
+
@font-face {
|
31
|
+
font-family: 'Nunito Sans';
|
32
|
+
font-style: normal;
|
33
|
+
font-weight: 700;
|
34
|
+
font-display: swap;
|
35
|
+
src: url('./sb-common-assets/nunito-sans-bold.woff2') format('woff2');
|
36
|
+
}
|
37
|
+
|
38
|
+
@font-face {
|
39
|
+
font-family: 'Nunito Sans';
|
40
|
+
font-style: italic;
|
41
|
+
font-weight: 700;
|
42
|
+
font-display: swap;
|
43
|
+
src: url('./sb-common-assets/nunito-sans-bold-italic.woff2') format('woff2');
|
44
|
+
}
|
45
|
+
</style>
|
18
46
|
|
19
47
|
<% if (typeof headHtmlSnippet !== 'undefined') { %> <%= headHtmlSnippet %> <% } %> <%
|
20
48
|
htmlWebpackPlugin.files.css.forEach(file => { %>
|
@@ -47,7 +75,11 @@
|
|
47
75
|
import './sb-preview/runtime.js';
|
48
76
|
|
49
77
|
<% htmlWebpackPlugin.files.js.forEach(file => { %>
|
50
|
-
|
78
|
+
<% if (file.startsWith('/')) { %>
|
79
|
+
import '.<%= file %>';
|
80
|
+
<% } else { %>
|
81
|
+
import './<%= file %>';
|
82
|
+
<% } %>
|
51
83
|
<% }); %>
|
52
84
|
</script>
|
53
85
|
</body>
|