@modern-js/module-tools-docs 2.54.3 → 2.54.4
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/CHANGELOG.md
CHANGED
|
@@ -67,7 +67,7 @@ When you get a problem like this, you can first open the browser console and the
|
|
|
67
67
|
|
|
68
68
|
Storybook does not provide a solution for this, but there is one in the Storybook Issue. In the Modern.js Module, you can:
|
|
69
69
|
|
|
70
|
-
1. Add the
|
|
70
|
+
1. Add the `.storybook/middleware.js` file and initialize the following:
|
|
71
71
|
|
|
72
72
|
``` js
|
|
73
73
|
/* eslint-disable filenames/match-exported */
|
|
@@ -94,3 +94,11 @@ module.exports = function expressMiddleware (router) {
|
|
|
94
94
|
```
|
|
95
95
|
|
|
96
96
|
Link:https://github.com/storybookjs/storybook/issues/11551
|
|
97
|
+
|
|
98
|
+
## Tailwind CSS doesn't work in Storybook
|
|
99
|
+
|
|
100
|
+
The Storybook build capability of the Modern.js Module is provided by [Rsbuild](https://rsbuild.dev/). Since the underlying implementation of Rsbuild is not integrated with Modern.js Module, the Modern.js Module plugins do not work in Storybook (Rsbuild).
|
|
101
|
+
|
|
102
|
+
Solution: Register the tailwindcss PostCSS plugin in storybook.
|
|
103
|
+
|
|
104
|
+
Reference link: [Rsbuild - tailwindcss](https://rsbuild.dev/guide/basic/tailwindcss#configuring-postcss).
|
|
@@ -67,7 +67,7 @@ var _await$Promise$all = await Promise.all([
|
|
|
67
67
|
|
|
68
68
|
Storybook 没有提供相关方案,不过 Storybook Issue 中有找到相关的解决办法。在 Modern.js Module 中,你可以:
|
|
69
69
|
|
|
70
|
-
1. 添加
|
|
70
|
+
1. 添加 `.storybook/middleware.js` 文件,并初始化下面的内容:
|
|
71
71
|
|
|
72
72
|
``` js
|
|
73
73
|
/* eslint-disable filenames/match-exported */
|
|
@@ -95,3 +95,10 @@ module.exports = function expressMiddleware (router) {
|
|
|
95
95
|
|
|
96
96
|
相关 issue 链接:[#11551](https://github.com/storybookjs/storybook/issues/11551)。
|
|
97
97
|
|
|
98
|
+
## Tailwind CSS 在 Storybook 中不生效
|
|
99
|
+
|
|
100
|
+
Modern.js Module 的 Storybook 构建能力由 [Rsbuild](https://rsbuild.dev/) 提供,由于 Rsbuild 的底层实现与 Modern.js Module 并未打通,因此, Modern.js Module 插件无法在 Storybook (Rsbuild) 中生效。
|
|
101
|
+
|
|
102
|
+
解决办法:需要在 storybook 中单独注册 tailwindcss 的 PostCSS 插件。
|
|
103
|
+
|
|
104
|
+
参考链接:[Rsbuild - tailwindcss](https://rsbuild.dev/zh/guide/basic/tailwindcss#%E9%85%8D%E7%BD%AE-postcss)。
|
package/package.json
CHANGED
|
@@ -9,14 +9,14 @@
|
|
|
9
9
|
"directory": "packages/document/module-doc"
|
|
10
10
|
},
|
|
11
11
|
"license": "MIT",
|
|
12
|
-
"version": "2.54.
|
|
12
|
+
"version": "2.54.4",
|
|
13
13
|
"main": "index.js",
|
|
14
14
|
"devDependencies": {
|
|
15
15
|
"react": "^18.2.0",
|
|
16
16
|
"react-dom": "^18.2.0",
|
|
17
17
|
"rspress": "1.18.2",
|
|
18
18
|
"@rspress/shared": "1.18.2",
|
|
19
|
-
"@modern-js/doc-plugin-auto-sidebar": "2.54.
|
|
19
|
+
"@modern-js/doc-plugin-auto-sidebar": "2.54.4"
|
|
20
20
|
},
|
|
21
21
|
"scripts": {
|
|
22
22
|
"dev": "rspress dev",
|