chore: move ci.js to ci.cjs

This commit is contained in:
alt0
2023-01-09 11:32:00 +08:00
parent cc5c16623a
commit 0179ad567e
6 changed files with 8 additions and 10 deletions
+1 -1
View File
@@ -36,7 +36,7 @@ jobs:
scope: '@toeverything' scope: '@toeverything'
cache: 'pnpm' cache: 'pnpm'
- run: node scripts/module-resolve/ci.js - run: node scripts/module-resolve/ci.cjs
- name: Restore cache - name: Restore cache
uses: actions/cache@v3 uses: actions/cache@v3
+1 -1
View File
@@ -244,7 +244,7 @@ jobs:
scope: '@toeverything' scope: '@toeverything'
cache: 'pnpm' cache: 'pnpm'
- run: node scripts/module-resolve/ci.js - run: node scripts/module-resolve/ci.cjs
- name: Restore cache - name: Restore cache
uses: actions/cache@v3 uses: actions/cache@v3
+1 -1
View File
@@ -23,7 +23,7 @@ jobs:
scope: '@toeverything' scope: '@toeverything'
cache: 'pnpm' cache: 'pnpm'
- run: node scripts/module-resolve/ci.js - run: node scripts/module-resolve/ci.cjs
- name: Install dependencies - name: Install dependencies
run: pnpm install --no-frozen-lockfile run: pnpm install --no-frozen-lockfile
+1
View File
@@ -48,6 +48,7 @@ Thumbs.db
out/ out/
module-resolve.js module-resolve.js
module-resolve.cjs
/test-results/ /test-results/
/playwright-report/ /playwright-report/
/playwright/.cache/ /playwright/.cache/
+2 -2
View File
@@ -1,11 +1,11 @@
const fs = require('fs'); const fs = require('fs');
function getCustomize() { function getCustomize() {
const customed = fs.existsSync('./module-resolve.js'); const customed = fs.existsSync('./module-resolve.cjs');
if (!customed) { if (!customed) {
return null; return null;
} }
const script = require('./module-resolve.js'); const script = require('./module-resolve.cjs');
return script && script.resolve; return script && script.resolve;
} }
@@ -2,12 +2,9 @@ const fs = require('fs');
const path = require('path'); const path = require('path');
const templatePath = path.resolve(__dirname, 'module-resolve.tmpl.js'); 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('template path', templatePath);
console.log('destination path', destinationPath); console.log('destination path', destinationPath);
fs.copyFileSync( fs.copyFileSync(templatePath, destinationPath);
templatePath,
destinationPath
);