vite-plugin-turbosnap
Advanced tools
Comparing version 1.0.2 to 1.0.3
{ | ||
"name": "vite-plugin-turbosnap", | ||
"version": "1.0.2", | ||
"version": "1.0.3", | ||
"description": "Enables the use of Chromatic Turbosnap in vite storybook projects", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
@@ -17,3 +17,3 @@ # vite-plugin-turbosnap | ||
- `chromatic-cli` [6.5.0](https://github.com/chromaui/chromatic-cli/blob/main/CHANGELOG.md#650---2022-02-21) or higher. | ||
- `@storybook/builder-vite` [0.1.22](https://github.com/storybookjs/builder-vite/releases/tag/v0.1.22) or higher. | ||
- Storybook 7.0+, or 6.5 with `@storybook/builder-vite` [0.1.22](https://github.com/storybookjs/builder-vite/releases/tag/v0.1.22) or higher. | ||
@@ -33,13 +33,21 @@ ### Install | ||
const turbosnap = require('vite-plugin-turbosnap'); | ||
const { mergeConfig } = require('vite'); | ||
import turbosnap from "vite-plugin-turbosnap"; | ||
import { mergeConfig } from "vite"; | ||
module.exports = { | ||
core: { builder: '@storybook/builder-vite' }, | ||
export default { | ||
// ... your existing storybook config | ||
async viteFinal(config, { configType }) { | ||
return mergeConfig(config, { | ||
plugins: configType === 'PRODUCTION' ? [turbosnap({ rootDir: config.root ?? process.cwd() })] : [], | ||
// ...And any other config you need to change... | ||
plugins: | ||
configType === "PRODUCTION" | ||
? [ | ||
turbosnap({ | ||
// This should be the base path of your storybook. In monorepos, you may only need process.cwd(). | ||
rootDir: config.root ?? process.cwd(), | ||
}), | ||
] | ||
: [], | ||
}); | ||
}, | ||
}; | ||
``` | ||
@@ -46,0 +54,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
10767
64