mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-07-23 21:38:44 +08:00
feat: module resolve
feat: module resolve fix: logger repository fix: module resolve chore: add workflow for module resolve chore: update workflow env chore: update workflow install chore: update workflow env for npm token chore: test docker chore: update workflow env
This commit is contained in:
@@ -0,0 +1,28 @@
|
||||
const fs = require('fs');
|
||||
|
||||
function getCustomize() {
|
||||
const customed = fs.existsSync('./module-resolve.js');
|
||||
if (!customed) {
|
||||
return null;
|
||||
}
|
||||
const script = require('./module-resolve.js');
|
||||
return script && script.resolve;
|
||||
}
|
||||
|
||||
const customize = getCustomize();
|
||||
|
||||
function readPackage(pkg) {
|
||||
if (!customize) {
|
||||
return pkg;
|
||||
}
|
||||
|
||||
const customizedPkg = customize(pkg);
|
||||
|
||||
return customizedPkg;
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
hooks: {
|
||||
readPackage,
|
||||
},
|
||||
};
|
||||
Reference in New Issue
Block a user