vite-plugin-storybook-nextjs 1.0.11 → 1.0.12--canary.23.ea692b3.0
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/README.md +2 -3
- package/dist/index.cjs +13 -2
- package/dist/index.js +13 -2
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -3,7 +3,6 @@
|
|
|
3
3
|
This is a Vite plugin that allows you to use Next.js features in Vite. It is the basis for `@storybook/experimental-nextjs-vite` and should be used when running portable stories in Vitest.
|
|
4
4
|
|
|
5
5
|
## Features
|
|
6
|
-
|
|
7
6
|
- **Next.js Integration**: Seamlessly integrate Next.js features into your Vite project.
|
|
8
7
|
- **Storybook Compatibility**: Acts as the foundation for [the `@storybook/experimental-nextjs-vite` framework](https://storybook.js.org/docs/get-started/frameworks/nextjs#with-vite), enabling you to use Storybook with Next.js in a Vite environment.
|
|
9
8
|
- **Portable Stories**: Ideal for running portable stories in Vitest, ensuring your components are tested in an environment that closely mirrors production.
|
|
@@ -116,12 +115,12 @@ When testing components that rely on Next.js Server Actions, you need to ensure
|
|
|
116
115
|
|
|
117
116
|
```ts
|
|
118
117
|
// vitest.config.ts
|
|
119
|
-
import { defineConfig } from "
|
|
118
|
+
import { defineConfig } from "vitest/config";
|
|
120
119
|
import nextjs from "vite-plugin-storybook-nextjs";
|
|
121
120
|
|
|
122
121
|
export default defineConfig({
|
|
123
122
|
plugins: [nextjs()],
|
|
124
|
-
|
|
123
|
+
test: {
|
|
125
124
|
environment: "jsdom", // 👈 Add this
|
|
126
125
|
},
|
|
127
126
|
});
|
package/dist/index.cjs
CHANGED
|
@@ -975,11 +975,11 @@ function VitePlugin({ dir = process.cwd() } = {}) {
|
|
|
975
975
|
alias: [
|
|
976
976
|
{
|
|
977
977
|
find: /^react$/,
|
|
978
|
-
replacement: "next/dist/compiled/react"
|
|
978
|
+
replacement: require6.resolve("next/dist/compiled/react")
|
|
979
979
|
},
|
|
980
980
|
{
|
|
981
981
|
find: /^react-dom$/,
|
|
982
|
-
replacement: "next/dist/compiled/react-dom"
|
|
982
|
+
replacement: require6.resolve("next/dist/compiled/react-dom")
|
|
983
983
|
},
|
|
984
984
|
{
|
|
985
985
|
find: /^react-dom\/server$/,
|
|
@@ -1008,6 +1008,17 @@ function VitePlugin({ dir = process.cwd() } = {}) {
|
|
|
1008
1008
|
]
|
|
1009
1009
|
}
|
|
1010
1010
|
},
|
|
1011
|
+
optimizeDeps: {
|
|
1012
|
+
include: [
|
|
1013
|
+
"@mdx-js/react",
|
|
1014
|
+
"@storybook/blocks",
|
|
1015
|
+
"next/dist/compiled/react",
|
|
1016
|
+
"next/image",
|
|
1017
|
+
"next/legacy/image",
|
|
1018
|
+
"react/jsx-dev-runtime",
|
|
1019
|
+
"styled-jsx/style"
|
|
1020
|
+
]
|
|
1021
|
+
},
|
|
1011
1022
|
test: {
|
|
1012
1023
|
alias: {
|
|
1013
1024
|
"react/jsx-dev-runtime": require6.resolve(
|
package/dist/index.js
CHANGED
|
@@ -941,11 +941,11 @@ function VitePlugin({ dir = process.cwd() } = {}) {
|
|
|
941
941
|
alias: [
|
|
942
942
|
{
|
|
943
943
|
find: /^react$/,
|
|
944
|
-
replacement: "next/dist/compiled/react"
|
|
944
|
+
replacement: require6.resolve("next/dist/compiled/react")
|
|
945
945
|
},
|
|
946
946
|
{
|
|
947
947
|
find: /^react-dom$/,
|
|
948
|
-
replacement: "next/dist/compiled/react-dom"
|
|
948
|
+
replacement: require6.resolve("next/dist/compiled/react-dom")
|
|
949
949
|
},
|
|
950
950
|
{
|
|
951
951
|
find: /^react-dom\/server$/,
|
|
@@ -974,6 +974,17 @@ function VitePlugin({ dir = process.cwd() } = {}) {
|
|
|
974
974
|
]
|
|
975
975
|
}
|
|
976
976
|
},
|
|
977
|
+
optimizeDeps: {
|
|
978
|
+
include: [
|
|
979
|
+
"@mdx-js/react",
|
|
980
|
+
"@storybook/blocks",
|
|
981
|
+
"next/dist/compiled/react",
|
|
982
|
+
"next/image",
|
|
983
|
+
"next/legacy/image",
|
|
984
|
+
"react/jsx-dev-runtime",
|
|
985
|
+
"styled-jsx/style"
|
|
986
|
+
]
|
|
987
|
+
},
|
|
977
988
|
test: {
|
|
978
989
|
alias: {
|
|
979
990
|
"react/jsx-dev-runtime": require6.resolve(
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vite-plugin-storybook-nextjs",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.12--canary.23.ea692b3.0",
|
|
4
4
|
"description": "",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"vite-plugin",
|
|
@@ -75,11 +75,11 @@
|
|
|
75
75
|
"react": "^18",
|
|
76
76
|
"rollup": "^4.18.0",
|
|
77
77
|
"sharp": "^0.33.4",
|
|
78
|
-
"storybook": "8.3.0
|
|
78
|
+
"storybook": "^8.3.0",
|
|
79
79
|
"tsup": "^8.1.0",
|
|
80
80
|
"typescript": "^5.0.0",
|
|
81
81
|
"vite": "^5.0.0",
|
|
82
|
-
"vitest": "^2.
|
|
82
|
+
"vitest": "^2.1.4"
|
|
83
83
|
},
|
|
84
84
|
"packageManager": "pnpm@9.4.0",
|
|
85
85
|
"dependencies": {
|