Skip to content

Commit

Permalink
[DEV-12476] Install vite-plugin-turbosnap
Browse files Browse the repository at this point in the history
  • Loading branch information
e1himself committed Feb 7, 2024
1 parent 1b4432c commit 6514a94
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 4 deletions.
14 changes: 14 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 7 additions & 2 deletions packages/ui/.storybook/main.js
Expand Up @@ -2,6 +2,7 @@ import { join, dirname } from 'path';
import { mergeConfig } from 'vite';
import tsconfigPaths from 'vite-tsconfig-paths';
import svgr from 'vite-plugin-svgr';
import turbosnap from 'vite-plugin-turbosnap';

/**
* This function is used to resolve the absolute path of a package.
Expand All @@ -28,9 +29,13 @@ const config = {
docs: {
autodocs: true,
},
viteFinal(config) {
viteFinal(config, { configType }) {
return mergeConfig(config, {
plugins: [tsconfigPaths(), svgr()],
plugins: [
configType === 'PRODUCTION' ? turbosnap({ rootDir: process.cwd() }) : undefined,
tsconfigPaths(),
svgr(),
].filter(Boolean),
define: {
'process.env': {},
},
Expand Down
12 changes: 10 additions & 2 deletions packages/ui/package.json
Expand Up @@ -2,7 +2,11 @@
"name": "@prezly/theme-kit-ui",
"version": "0.0.0-next-5cafa5f44882b39a051c5b6eab938bfc236ef573",
"description": "UI components for Prezly themes",
"keywords": ["prezly", "themes", "ui"],
"keywords": [
"prezly",
"themes",
"ui"
],
"author": {
"name": "Prezly Team"
},
Expand All @@ -19,7 +23,10 @@
"default": "./build/index.mjs"
}
},
"files": ["build", "README.md"],
"files": [
"build",
"README.md"
],
"repository": {
"type": "git",
"url": "git+https://github.com/prezly/theme-kit-js.git"
Expand Down Expand Up @@ -73,6 +80,7 @@
"vite": "4.5.2",
"vite-plugin-dts": "3.7.2",
"vite-plugin-svgr": "4.2.0",
"vite-plugin-turbosnap": "^1.0.3",
"vite-tsconfig-paths": "4.2.3"
},
"dependencies": {
Expand Down

0 comments on commit 6514a94

Please sign in to comment.