style(runtime): 配置格式化

This commit is contained in:
roymondchen 2025-08-27 17:01:08 +08:00
parent a10f9d230d
commit 7695f005f6
10 changed files with 42 additions and 36 deletions

View File

@ -1,2 +1,4 @@
.tmagic
entry-dist
dist
*.local
*.local.*

View File

@ -11,7 +11,7 @@
"dev:react": "vite --force",
"serve": "vite preview",
"build": "rimraf ./dist && node scripts/build.mjs --type=all && npm run build:client",
"build:libs": "tmagic entry && node scripts/build.mjs --type=res",
"build:libs": "npm run tmagic && node scripts/build.mjs --type=res",
"build:client": "vite build --config ./page/vite.config.ts && vite build --config ./playground/vite.config.ts"
},
"dependencies": {

View File

@ -2,6 +2,7 @@ import path from 'node:path';
import { fileURLToPath } from 'node:url';
import { build as buildVite } from 'vite';
import fse from 'fs-extra';
import minimist from 'minimist';
import resViteConfig from './vite.res.config.mjs';
@ -12,9 +13,9 @@ const dirname = path.dirname(fileURLToPath(import.meta.url));
const buildList = [];
const buildRes = args.type === 'res' || args.type === 'all';
if (args.type === 'res' || args.type === 'all') {
fse.removeSync(path.resolve(dirname, '../dist/entry'));
if (buildRes) {
for (const mode of ['value', 'config', 'event', 'ds:value', 'ds:config', 'ds:event']) {
buildList.push(
buildVite({

View File

@ -14,9 +14,6 @@ export default defineConfig((mode) => {
const fileName = mode.replace(':', '-');
const publicPath = path.resolve(dirname, '../dist/entry', fileName);
fse.removeSync(publicPath);
return {
plugins: [
{
@ -24,7 +21,10 @@ export default defineConfig((mode) => {
apply: 'build',
enforce: 'post',
closeBundle() {
fse.copySync(publicPath, path.resolve(dirname, `../../../playground/public/entry/react/${fileName}`));
fse.copySync(
path.resolve(dirname, '../dist/entry', fileName),
path.resolve(dirname, '../../../playground/public/entry/react/', fileName),
);
},
},
],

View File

@ -18,6 +18,6 @@ export default defineConfig({
'page-fragment-container': '@tmagic/react-page-fragment-container',
'qrcode': '@tmagic/react-qrcode',
'text': '@tmagic/react-text',
}
},
],
});

View File

@ -1,2 +1,4 @@
.tmagic
dist
*.local
*.local.*

View File

@ -11,7 +11,7 @@
"dev": "vite --force",
"serve": "vite preview",
"build": "rimraf ./dist && node scripts/build.mjs --type=all && npm run build:client",
"build:libs": "tmagic entry && node scripts/build.mjs --type=res",
"build:libs": "npm run tmagic && node scripts/build.mjs --type=res",
"build:client": "vite build --config ./page/vite.config.ts && vite build --config ./playground/vite.config.ts"
},
"dependencies": {

View File

@ -2,6 +2,7 @@ import path from 'node:path';
import { fileURLToPath } from 'node:url';
import { build as buildVite } from 'vite';
import fse from 'fs-extra';
import minimist from 'minimist';
import resViteConfig from './vite.res.config.mjs';
@ -12,9 +13,9 @@ const dirname = path.dirname(fileURLToPath(import.meta.url));
const buildList = [];
const buildRes = args.type === 'res' || args.type === 'all';
if (args.type === 'res' || args.type === 'all') {
fse.removeSync(path.resolve(dirname, '../dist/entry'));
if (buildRes) {
for (const mode of ['value', 'config', 'event', 'ds:value', 'ds:config', 'ds:event']) {
buildList.push(
buildVite({

View File

@ -14,9 +14,6 @@ export default defineConfig((mode) => {
const fileName = mode.replace(':', '-');
const publicPath = path.resolve(dirname, '../dist/entry', fileName);
fse.removeSync(publicPath);
return {
plugins: [
{
@ -24,7 +21,10 @@ export default defineConfig((mode) => {
apply: 'build',
enforce: 'post',
closeBundle() {
fse.copySync(publicPath, path.resolve(dirname, `../../../playground/public/entry/vue/${fileName}`));
fse.copySync(
path.resolve(dirname, '../dist/entry', fileName),
path.resolve(dirname, '../../../playground/public/entry/vue/', fileName),
);
},
},
],

View File

@ -19,6 +19,6 @@ export default defineConfig({
'page-fragment-container': '@tmagic/vue-page-fragment-container',
'qrcode': '@tmagic/vue-qrcode',
'text': '@tmagic/vue-text',
}
},
],
});