Skip to content

Commit

Permalink
chore: vue/cli replace vite
Browse files Browse the repository at this point in the history
  • Loading branch information
richard1015 committed Feb 24, 2021
1 parent 4cede4c commit 30f2564
Show file tree
Hide file tree
Showing 19 changed files with 661 additions and 599 deletions.
7 changes: 2 additions & 5 deletions src/sites/mobile/index.html → demo.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,7 @@
content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0"
name="viewport"
/>
<link rel="icon" href="<%= BASE_URL %>favicon.ico" />
<title><%= htmlWebpackPlugin.options.title %></title>
<!-- <title>NutUI - 移动端Vue组件库</title> -->
<title>NutUI - 移动端Vue组件库</title>
<script src="https://h5.m.jd.com/babelDiy/Zeus/2846ykuM7PwipD9E2RzMj2BGEQpA/plugin/share.min.js"></script>
<style>
html {
Expand All @@ -31,8 +29,7 @@
>
</noscript>
<div id="app"></div>

<!-- built files will be auto injected -->
<script type="module" src="./src//sites/mobile/main.ts"></script>
<script>
//分享配置
var shareOption = {
Expand Down
6 changes: 2 additions & 4 deletions src/sites/doc/index.html → index.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,7 @@
content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0"
name="viewport"
/>
<link rel="icon" href="<%= BASE_URL %>favicon.ico" />
<title><%= htmlWebpackPlugin.options.title %></title>
<!-- <title>NutUI - 移动端Vue组件库</title> -->
<title>NutUI - 移动端Vue组件库</title>
<script src="https://h5.m.jd.com/babelDiy/Zeus/2846ykuM7PwipD9E2RzMj2BGEQpA/plugin/share.min.js"></script>
<style>
html {
Expand Down Expand Up @@ -47,7 +45,7 @@
>
</noscript>
<div id="doc"></div>
<!-- built files will be auto injected -->
<script type="module" src="./src//sites/doc/main.ts"></script>
<script>
//分享配置
var shareOption = {
Expand Down
49 changes: 15 additions & 34 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
"webpack",
"vue component",
"vue3 component",
"vite",
"jdc",
"jdcfe"
],
Expand All @@ -35,35 +36,24 @@
"CHANGELOG.md"
],
"scripts": {
"dev": "vue-cli-service serve",
"serve": "vue-cli-service serve",
"build": "vue-cli-service build",
"lint": "vue-cli-service lint",
"upload": "vue-cli-service build && node ./jd/upload.js",
"dev": "vite",
"build": "vite build",
"serve": "vite preview",
"upload": "vite build && node ./jd/upload.js",
"add": "node jd/createComponentMode.js"
},
"dependencies": {
"@types/swiper": "^5.4.1",
"axios": "^0.21.0",
"core-js": "^3.6.5",
"gsap": "^3.6.0",
"sass": "^1.27.0",
"sass-loader": "^10.0.4",
"swiper": "^4.0.2",
"vue": "^3.0.0",
"vue-router": "^4.0.0-rc.1"
"sass": "^1.32.8",
"vue": "^3.0.5",
"vue-router": "^4.0.4"
},
"devDependencies": {
"@commitlint/cli": "^10.0.0",
"@commitlint/config-conventional": "^10.0.0",
"@typescript-eslint/eslint-plugin": "^2.33.0",
"@typescript-eslint/parser": "^2.33.0",
"@vue/cli-plugin-babel": "~4.5.8",
"@vue/cli-plugin-eslint": "~4.5.8",
"@vue/cli-plugin-router": "~4.5.8",
"@vue/cli-plugin-typescript": "~4.5.8",
"@vue/cli-service": "~4.5.8",
"@vue/compiler-sfc": "^3.0.2",
"@vitejs/plugin-vue": "^1.1.4",
"@vue/compiler-sfc": "^3.0.5",
"@vue/eslint-config-prettier": "^6.0.0",
"@vue/eslint-config-typescript": "^5.0.2",
"eslint": "^6.7.2",
Expand All @@ -73,16 +63,12 @@
"highlight.js": "^10.3.1",
"husky": "^4.3.0",
"lint-staged": "^10.5.0",
"loader-utils": "^2.0.0",
"markdown-it": "^12.0.2",
"markdown-it-anchor": "^6.0.0",
"markdown-it-chain": "^1.3.0",
"markdown-it-container": "^3.0.0",
"prettier": "^1.19.1",
"swiper": "4.0.2",
"transliteration": "^2.2.0",
"typescript": "~3.9.3",
"vue-loader": "16.0.0-beta.7",
"vue-template-compiler": "^2.6.12"
"typescript": "^4.1.5",
"vite": "^2.0.2",
"vite-plugin-md": "^0.5.1"
},
"eslintConfig": {
"root": true,
Expand Down Expand Up @@ -116,10 +102,5 @@
"repository": {
"type": "git",
"url": "https://github.com/jdf2e/nutui.git"
},
"browserslist": [
"> 1%",
"last 2 versions",
"not dead"
]
}
}
23 changes: 23 additions & 0 deletions scripts/gen-nutui-main.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
/**
* 生成入口文件
*/
export class Gen {
constructor() {
this.init();
}

init() {
const template = `
import { App } from 'vue';
export default {
install(app: App<Element>): void {
const files = require.context('@/packages', true, /index\.vue$/);
files.keys().forEach(component => {
const componentEntity = files(component).default;
app.component(componentEntity.name, componentEntity);
});
}
};
`;
}
}
Loading

0 comments on commit 30f2564

Please sign in to comment.