element-plus / element-plus-vite-starter

🌰 A starter kit for Element Plus with Vite
https://vite-starter.element-plus.org
1.1k stars 362 forks source link

请问有vite-ts模板吗 npm无法打包 #12

Closed Carson-czl closed 3 years ago

Carson-czl commented 3 years ago

自己搭建出来的ts模板无法打包

npm run build

经过尝试确认 yarn build 是没问题的之后npm是出现打包不了的问题

{ "name": "vue3-vite-admin", "version": "0.0.0", "scripts": { "dev": "vite", "build": "vue-tsc --noEmit && vite build", "serve": "vite preview" }, "dependencies": { "axios": "^0.21.1", "element-plus": "^1.0.2-beta.35", "vue": "^3.0.5", "vue-router": "4.0.5", "vuex": "4.0.0" }, "devDependencies": { "@vitejs/plugin-vue": "^1.1.5", "@vue/compiler-sfc": "^3.0.5", "node-sass": "^5.0.0", "sass-loader": "^11.0.1", "typescript": "^4.1.3", "vite": "^2.1.0", "vue-tsc": "^0.0.8" } }

Bluestar123 commented 3 years ago

我也遇到了,使用element-plus打包类型问题,vue-tsc --noEmit,去了这个可以。但是有什么办法过滤掉node_modules里面的检查?

Carson-czl commented 3 years ago

我也遇到了,使用element-plus打包类型问题,vue-tsc --noEmit,去了这个可以。但是有什么办法过滤掉node_modules里面的检查?

我已经解决了下载最新的ts模板就可以了,因为当时官方vue-tsc这个插件旧了没更新

ssw1992 commented 3 years ago

Z2)F6}7I59%8~CT{18LATZJ F{~JO 5L%DDRYRA_8)5J506

升级最新版一个样,打包的时候过不了vue-tsc的检查

ssw1992 commented 3 years ago

上次的问题处理了,我在全局类型加了对应类型 image 并引入了 image

这次打包又报其他问题,也是类型缺失 总结两类问题,一类引入的框子的类型,使用vue-tsc --noEmit会出现框子里的类型检测不到,报类型缺失问题 另一类,开发的时候没有vue-tsc --noEmit,检测不到这类问题,一打包,使用vue-tsc --noEmit,就会出现的问题

Carson-czl commented 3 years ago

上次的问题处理了,我在全局类型加了对应类型 image 并引入了 image

这次打包又报其他问题,也是类型缺失 总结两类问题,一类引入的框子的类型,使用vue-tsc --noEmit会出现框子里的类型检测不到,报类型缺失问题 另一类,开发的时候没有vue-tsc --noEmit,检测不到这类问题,一打包,使用vue-tsc --noEmit,就会出现的问题

我这边之前试过是没问题的打包没问题,主要把自己项目里的类型都解决完才能打包的

{
  "name": "vue3-vite-admin",
  "version": "0.0.0",
  "scripts": {
    "dev": "vite",
    "build:prod": "vue-tsc --noEmit && vite build",
    "build:stage": "vue-tsc --noEmit && vite build --mode staging",
    "serve": "vite preview"
  },
  "dependencies": {
    "axios": "^0.21.1",
    "crypto-js": "^4.0.0",
    "element-plus": "^1.0.2-beta.41",
    "js-cookie": "^2.2.1",
    "normalize.css": "^8.0.1",
    "nprogress": "^0.2.0",
    "path-to-regexp": "^6.2.0",
    "vue": "^3.0.11",
    "vue-router": "^4.0.6",
    "vuex": "^4.0.0"
  },
  "devDependencies": {
    "@amap/amap-jsapi-loader": "^1.0.1",
    "@types/crypto-js": "^4.0.1",
    "@types/js-cookie": "^2.2.6",
    "@types/node": "^14.14.42",
    "@types/nprogress": "^0.2.0",
    "@typescript-eslint/eslint-plugin": "^4.22.0",
    "@typescript-eslint/parser": "^4.22.0",
    "@vitejs/plugin-legacy": "^1.3.2",
    "@vitejs/plugin-vue": "^1.2.2",
    "@vue/compiler-sfc": "^3.0.11",
    "@vue/eslint-config-prettier": "^6.0.0",
    "@vue/eslint-config-typescript": "^7.0.0",
    "eslint": "^7.25.0",
    "eslint-config-prettier": "^8.3.0",
    "eslint-plugin-prettier": "^3.4.0",
    "eslint-plugin-vue": "^7.9.0",
    "prettier": "^2.2.1",
    "sass": "^1.32.11",
    "typescript": "^4.2.4",
    "vite": "^2.2.3",
    "vite-plugin-svg-icons": "^0.5.0",
    "vue-tsc": "0.0.25"
  }
}
mrerhuo commented 3 years ago

还是不稳定。放弃。。

YunYouJun commented 3 years ago

Template has upgraded to ts, but type of element-plus need to be enhanced.