Skip to content

Commit

Permalink
ci: 修复转换vue文件 setup 属性bug,发布流程打包性能优化
Browse files Browse the repository at this point in the history
修复转换vue文件 setup 属性bug,发布流程打包性能优化
  • Loading branch information
hewx815 committed Sep 25, 2023
1 parent 87b781c commit 81e001a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion cli/scripts/release.js
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ const main = async () => {

// 打包
log('开始构建npm包');
spawnSync('yarn build', { shell: true, stdio: 'inherit' });
spawnSync('yarn build:npm', { shell: true, stdio: 'inherit' });
log('构建npm包结束');

// 发布
Expand Down
2 changes: 1 addition & 1 deletion cli/scripts/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,7 @@ export const tsToJs = (folderPath) => {
const updatedVueContent = vueContent.replace(/<script(?:[^>]*)\s+lang=(?:"ts"|'ts')(?:[^>]*)>([\s\S]*?)<\/script>/g, (match, scriptContent) => {
const isSetupTag = /<script(?:[^>]*)\s+lang=(?:"ts"|'ts')(?:[^>]*)\s+setup(?:[^>]*)>/.test(match);
const jsContent = processTsScript(scriptContent);
return `<script ${isSetupTag ? ' setup' : ''}lang="js">\n${jsContent}\n</script>`;
return `<script ${isSetupTag ? 'setup ' : ''}lang="js">\n${jsContent}\n</script>`;
});
fs.writeFileSync(filePath, updatedVueContent, 'utf-8');
} else if (path.extname(filePath) === '.ts' && !file.includes('.d.ts')) {
Expand Down

0 comments on commit 81e001a

Please sign in to comment.