mirror of
https://github.com/WeBankFinTech/fes.js.git
synced 2025-06-05 00:29:21 +08:00
26 lines
709 B
JavaScript
26 lines
709 B
JavaScript
/**
|
||
* @copy 该文件代码大部分出自 umi,有需要请参考:
|
||
* https://github.com/umijs/umi/blob/master/packages/umi/src/ServiceWithBuiltIn.ts
|
||
*/
|
||
|
||
import { dirname } from 'path';
|
||
import { Service as CoreService } from '@fesjs/compiler';
|
||
|
||
class Service extends CoreService {
|
||
constructor(opts) {
|
||
process.env.FES_VERSION = require('../package').version;
|
||
process.env.FES_DIR = dirname(require.resolve('../package'));
|
||
|
||
super({
|
||
...opts,
|
||
presets: [
|
||
require.resolve('@fesjs/preset-built-in'),
|
||
...(opts.presets || [])
|
||
],
|
||
plugins: [...(opts.plugins || [])]
|
||
});
|
||
}
|
||
}
|
||
|
||
export { Service };
|