how do vite support babel
See original GitHub issueDoes vite support babel ?
for example, when I use webpack, I can create a .babelrc file as below
by using babel-plugin-import
// .babelrc or babel-loader option
{
"plugins": [
["import", { "libraryName": "ant-design-vue", "libraryDirectory": "es", "style": "css" }]
]
}
and then I can just import the module from ant-design-vue,
// babel-plugin-import can help us load js and css
import { DatePicker } from 'ant-design-vue';
instead of import the style separately, as follows:
import DatePicker from 'ant-design-vue/lib/date-picker'; // load js
import 'ant-design-vue/lib/date-picker/style/css'; // load css
// import 'ant-design-vue/lib/date-picker/style'; // load less
Describe the solution you’d like
Hope that vite can also provide a plugin similar to babel-plugin-import
Issue Analytics
- State:
- Created 3 years ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
How to replace webpack & babel with Vite on a legacy React ...
Plus you don't need Babel if you're using Vite so you can get rid of a tonne of dependencies and security vulnerability messages....
Read more >vite-plugin-babel - npm
Runs Babel in Vite during all commands. Latest version: 1.1.2, last published: 4 months ago. Start using vite-plugin-babel in your project ...
Read more >is it required babel configuration when I use vite in place of ...
No, vite does automatic syntax transforms but it only targets browsers that support es modules (firefox & chrome started supporting it ...
Read more >Plugins - Vite
Vite aims to provide out-of-the-box support for common web development patterns. ... Provides Vue 3 JSX support (via dedicated Babel transform).
Read more >vite-plugin-babel - NPM Package Overview - Socket.dev
Most Vite plugins runs Babel only during build , not serve , and only other possible way to do this is via @vitejs/plugin-react....
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@lubanproj https://github.com/vbenjs/vite-plugin-style-import This may satisfy you
ant-design-vue issue: https://github.com/vueComponent/ant-design-vue/issues/3570