mirror of
https://github.com/WeBankFinTech/fes.js.git
synced 2025-05-29 03:19:19 +08:00
21 lines
434 B
JavaScript
21 lines
434 B
JavaScript
// my-module/register.js
|
|
import { join } from 'node:path';
|
|
import { addHook } from 'pirates';
|
|
|
|
function matcher(filename) {
|
|
return filename.endsWith(join(...['fes', 'lib', 'index.js']));
|
|
}
|
|
|
|
export function hackFesInBuild() {
|
|
addHook(
|
|
() => `
|
|
module.exports = {
|
|
defineBuildConfig(params) {
|
|
return params;
|
|
}
|
|
}
|
|
`,
|
|
{ exts: ['.js'], ignoreNodeModules: false, matcher },
|
|
);
|
|
}
|