Vite examples #37
Replies: 5 comments 12 replies
-
I had a crack at it too but hit the same roadblock - some googling came up with the replace plugin to remove // vite.config.ts
import reactRefresh from '@vitejs/plugin-react-refresh'
import { babel } from '@rollup/plugin-babel';
import replace from '@rollup/plugin-replace';
import { defineConfig } from 'vite'
export default defineConfig({
plugins: [reactRefresh(),],
build: {
rollupOptions: {
plugins: [
replace({
'process.platform': JSON.stringify('win32')
}),
babel({ babelHelpers: 'bundled' })
]
}
}
}) |
Beta Was this translation helpful? Give feedback.
-
Ah, I see. Thanks for looking into it. I also will look further into this. |
Beta Was this translation helpful? Give feedback.
-
Can't get it works, any ideas? |
Beta Was this translation helpful? Give feedback.
-
Ok we've got vite@2.0.5 + twin.macro@2.3.0 working together! // vite.config.ts
import reactRefresh from '@vitejs/plugin-react-refresh'
import { defineConfig } from 'vite'
export default defineConfig({
plugins: [reactRefresh()],
define: {
'process.platform': JSON.stringify('win32'),
'process.env': {},
},
}) // .babelrc.js
module.exports = {
plugins: ["babel-plugin-macros"],
}; The next step would be a little more testing and then put together a twin.example 👍 |
Beta Was this translation helpful? Give feedback.
-
The vite + styled-components example is now live 🎉 |
Beta Was this translation helpful? Give feedback.
-
Hello, I would like to know how to integrate
twin.macro
withVite
Just tried it before but I got an issue here vitejs/vite#1942
Thanks before
Beta Was this translation helpful? Give feedback.
All reactions