From 4b462d618781f50323c0470420705f48b1ee0cc2 Mon Sep 17 00:00:00 2001 From: lelexia <1095883487@qq.com> Date: Tue, 27 Oct 2026 17:03:45 +0800 Subject: [PATCH] fix(build): resolve package.json from script paths --- docsSource/index.js | 3 +-- postcss.config.js | 5 ++++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/docsSource/index.js b/docsSource/index.js index 516a29c9c..6e106109e 100644 --- a/docsSource/index.js +++ b/docsSource/index.js @@ -1,7 +1,7 @@ const path = require('path'); const fs = require('fs'); -const {version} = JSON.parse(fs.readFileSync('package.json')); +const {version} = JSON.parse(fs.readFileSync(path.join(__dirname, '../package.json'))); const compileMD = require('./compileMD'); const compileAnimationList = require('./compileAnimationList'); @@ -23,4 +23,3 @@ fs.writeFile(output, withVersion, 'utf8', (err) => { if (err) console.error(err); console.log('Template compiled succesfully.'); }); - diff --git a/postcss.config.js b/postcss.config.js index 14d6401f3..faec7ad96 100644 --- a/postcss.config.js +++ b/postcss.config.js @@ -1,5 +1,8 @@ const fs = require('fs'); -const {homepage, version, author, animateConfig} = JSON.parse(fs.readFileSync('package.json')); +const path = require('path'); +const {homepage, version, author, animateConfig} = JSON.parse( + fs.readFileSync(path.join(__dirname, 'package.json')), +); const header = ` @charset "UTF-8";