refactor(build): 移除package.json中的version字段并调整构建顺序
移除docs和widget模块package.json中的version字段,这些版本由主项目统一管理 调整cwd-admin的构建脚本顺序,先构建admin再复制widget文件到public目录
This commit is contained in:
16
cwd-admin/copy-cwd-to-public.js
Normal file
16
cwd-admin/copy-cwd-to-public.js
Normal file
@@ -0,0 +1,16 @@
|
||||
import fs from "fs";
|
||||
import path from "path";
|
||||
import { fileURLToPath } from "url";
|
||||
|
||||
const __filename = fileURLToPath(import.meta.url);
|
||||
const __dirname = path.dirname(__filename);
|
||||
|
||||
const src = path.resolve(__dirname, "widget/dist/cwd.js");
|
||||
const destDir = path.resolve(__dirname, "public");
|
||||
const dest = path.resolve(destDir, "cwd.js");
|
||||
|
||||
if (!fs.existsSync(destDir)) {
|
||||
fs.mkdirSync(destDir, { recursive: true });
|
||||
}
|
||||
|
||||
fs.copyFileSync(src, dest);
|
||||
@@ -8,7 +8,7 @@
|
||||
"preview": "vite preview",
|
||||
"build:admin": "vite build",
|
||||
"build:widget": "cd widget && npm install && npm run build",
|
||||
"build": "npm run build:widget &&npm run build:admin"
|
||||
"build": "npm run build:admin && node copy-cwd-to-public.js && npm run build:widget"
|
||||
},
|
||||
"dependencies": {
|
||||
"vue": "^3.5.13",
|
||||
|
||||
1
cwd-admin/public/cwd.js
Normal file
1
cwd-admin/public/cwd.js
Normal file
File diff suppressed because one or more lines are too long
@@ -1,6 +1,5 @@
|
||||
{
|
||||
"name": "widget",
|
||||
"version": "0.0.1",
|
||||
"private": true,
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
{
|
||||
"name": "docs",
|
||||
"version": "0.0.1",
|
||||
"description": "CWD 评论系统文档",
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
|
||||
Reference in New Issue
Block a user