Comments (1)
Hello, author My element-ui is version 2.13.2,vite version is 3.1.0,When packaged with vite, the element-ui el-input component is invalidated,And missing styles for some components,For example, the el-main component style is missing,There is nothing wrong with the development environment,This problem occurs after packing In a production environment。
- This is my configuration in vite.config.js
import vitePluginImportus from 'vite-plugin-importus'
plugins: [
vitePluginImportus([
{
libraryName: 'element-ui',
styleLibraryDirectory: "lib/theme-chalk",
customName: (name, file) => {
returnelement-ui/lib/${name}
;
},
customStyleName: (name, file) => {
returnelement-ui/lib/theme-chalk/${name}.css
;
}
}
]
)
],- This is the configuration in my package.json
{
"name": "my-project",
"private": true,
"version": "0.0.0",
"type": "module",
"scripts": {
"dev": "vite",
"build": "vite build --mode production",
"build:test": "vite build --mode test",
"preview": "vite preview"
},
"resolutions": {
"bin-wrapper": "npm:bin-wrapper-china"
},
"devDependencies": {
"@vitejs/plugin-legacy": "^2.3.0",
"autoprefixer": "^10.4.13",
"rollup-plugin-visualizer": "^5.8.3",
"sass": "^1.55.0",
"vite": "^3.1.0",
"vite-plugin-compression": "^0.5.1",
"vite-plugin-imagemin": "^0.6.1",
"vite-plugin-importus": "^1.0.4",
"vite-plugin-vue2": "^2.0.2"
},
"dependencies": {
"axios": "^1.1.3",
"element-ui": "^2.13.2",
"js-cookie": "^3.0.1",
"lodash-es": "^4.17.21",
"vue": "2.5.2",
"vue-router": "3.0.1",
"vue-template-compiler": "2.5.2",
"vuex": "3.0.1"
}
}- This is the configuration in my main.js
// ...Introduction of other components
import {Input} from 'element-ui'
Vue.use(Input);Looking forward to your reply at last. Thank you!
Thanks for your feedback! I try using elementui with vite-plugin-importus, but it work well, please view this demo.
Please make sure if other plugin's problem?
from vite-plugin-importus.
Related Issues (6)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from vite-plugin-importus.