Skip to content

Commit

Permalink
chore: 优化sdk打包命令 (#339)
Browse files Browse the repository at this point in the history
  • Loading branch information
Qiu-Jun authored Apr 18, 2024
1 parent daecb68 commit 4132481
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 11 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
.DS_Store
node_modules
/dist
dist

# local env files
.env.local
Expand Down
11 changes: 6 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,16 @@
"version": "1.0.0",
"description": "a template project for vue3, ViewUIPlus, TypeScript and Vite.",
"scripts": {
"serve": "npm run dev",
"preinstall": "npx only-allow pnpm",
"serve": "pnpm dev",
"dev": "vite serve",
"dev:staging": "vite serve --mode=staging",
"dev:prod": "vite serve --mode=production",
"build": "vite build",
"build:sdk": "vite build --config viteSDK.config.ts",
"build:sdk": "pnpm -C packages/core build",
"build:staging": "vite build --mode=staging",
"preview": "npm run build && vite preview",
"preview:staging": "npm run build:staging && vite preview --mode=staging",
"preview": "pnpm build && vite preview",
"preview:staging": "pnpm build:staging && vite preview --mode=staging",
"prepare": "husky install"
},
"dependencies": {
Expand Down Expand Up @@ -72,4 +73,4 @@
"prettier --write"
]
}
}
}
4 changes: 2 additions & 2 deletions packages/core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"description": "",
"main": "index.ts",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
"build": "vite build"
},
"dependencies": {
"events": "^3.3.0",
Expand All @@ -17,4 +17,4 @@
"keywords": [],
"author": "",
"license": "ISC"
}
}
8 changes: 5 additions & 3 deletions viteSDK.config.ts → packages/core/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,23 @@
* @version:
* @Author: June
* @Date: 2023-04-24 00:25:39
* @LastEditors: 秦少卫
* @LastEditTime: 2024-03-17 13:46:56
* @LastEditors: June [email protected]
* @LastEditTime: 2024-04-18 10:14:25
*/
import { defineConfig } from 'vite';
import eslintPlugin from 'vite-plugin-eslint'; //导入包
import { resolve } from 'path';

const config = () => {
return {
base: './',
build: {
lib: {
entry: resolve(__dirname, './packages/core/index.ts'),
entry: resolve(__dirname, './index.ts'),
name: 'Kuaitu',
fileName: 'index',
},
outDir: resolve(__dirname, '../../dist'),
},
plugins: [
// 增加下面的配置项,这样在运行时就能检查eslint规范
Expand Down

0 comments on commit 4132481

Please sign in to comment.