Fix storybook build

pull/2529/head
Jérémy Rialland 2023-03-01 15:38:46 +01:00 committed by Johan Girod
parent 29f2648036
commit 7d2575d46f
2 changed files with 3 additions and 8 deletions

View File

@ -1,6 +1,6 @@
// TODO: Move to ESModule
const { loadConfigFromFile, mergeConfig } = require('vite')
const reactPlugin = require('@vitejs/plugin-react')
const reactPlugin = require('@vitejs/plugin-react-swc')
const path = require('path')
const VitePWA = require('vite-plugin-pwa').VitePWA
const yaml = require('@rollup/plugin-yaml')
@ -55,12 +55,7 @@ module.exports = {
!(Array.isArray(plugin) && plugin[0].name === 'vite:react-babel')
),
reactPlugin({
babel: {
plugins: ['babel-plugin-styled-components'],
},
// Copied from https://github.com/eirslett/storybook-builder-vite/blob/917d8868943ec5f58c9c2c6900e196637f0d05e3/packages/storybook-builder-vite/vite-config.ts#L95
// Do not treat story files as HMR boundaries, storybook itself needs to handle them.
exclude: [/\.stories\.([tj])sx?$/, /node_modules/],
plugins: [['@swc/plugin-styled-components', { pure: true }]],
}),
yaml(),
VitePWA({ disable: true }),

View File

@ -1,6 +1,6 @@
import React from 'react'
import { DarkModeProvider } from '@/contexts/DarkModeContext'
import { DarkModeProvider } from '@/components/utils/DarkModeContext'
import { GlobalStyle } from '@/design-system/index'
import DesignSystemThemeProvider from '@/design-system/root'