diff --git a/.github/workflows/build-test-version.yml b/.github/workflows/build-test-version.yml index 3862fefa32..9eb1aaf6d4 100644 --- a/.github/workflows/build-test-version.yml +++ b/.github/workflows/build-test-version.yml @@ -36,7 +36,7 @@ jobs: scope: '@toeverything' cache: 'pnpm' - - run: node scripts/module-resolve/ci.js + - run: node scripts/module-resolve/ci.cjs - name: Restore cache uses: actions/cache@v3 diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index bcc0166423..6d0c262639 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -244,7 +244,7 @@ jobs: scope: '@toeverything' cache: 'pnpm' - - run: node scripts/module-resolve/ci.js + - run: node scripts/module-resolve/ci.cjs - name: Restore cache uses: actions/cache@v3 diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 94d64c8f46..00ce55b51c 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -23,7 +23,7 @@ jobs: scope: '@toeverything' cache: 'pnpm' - - run: node scripts/module-resolve/ci.js + - run: node scripts/module-resolve/ci.cjs - name: Install dependencies run: pnpm install --no-frozen-lockfile diff --git a/.gitignore b/.gitignore index 24bb279128..f9333264dc 100644 --- a/.gitignore +++ b/.gitignore @@ -48,6 +48,7 @@ Thumbs.db out/ module-resolve.js +module-resolve.cjs /test-results/ /playwright-report/ /playwright/.cache/ diff --git a/.pnpmfile.cjs b/.pnpmfile.cjs index 4873d9492c..d2541eb7e9 100644 --- a/.pnpmfile.cjs +++ b/.pnpmfile.cjs @@ -1,11 +1,11 @@ const fs = require('fs'); function getCustomize() { - const customed = fs.existsSync('./module-resolve.js'); + const customed = fs.existsSync('./module-resolve.cjs'); if (!customed) { return null; } - const script = require('./module-resolve.js'); + const script = require('./module-resolve.cjs'); return script && script.resolve; } diff --git a/scripts/module-resolve/ci.js b/scripts/module-resolve/ci.cjs similarity index 81% rename from scripts/module-resolve/ci.js rename to scripts/module-resolve/ci.cjs index 44c57a08d8..05b8b4c19f 100644 --- a/scripts/module-resolve/ci.js +++ b/scripts/module-resolve/ci.cjs @@ -2,12 +2,9 @@ const fs = require('fs'); const path = require('path'); const templatePath = path.resolve(__dirname, 'module-resolve.tmpl.js'); -const destinationPath = path.resolve(__dirname, '../../module-resolve.js'); +const destinationPath = path.resolve(__dirname, '../../module-resolve.cjs'); console.log('template path', templatePath); console.log('destination path', destinationPath); -fs.copyFileSync( - templatePath, - destinationPath -); +fs.copyFileSync(templatePath, destinationPath);