加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
.fatherrc.js 1.19 KB
一键复制 编辑 原始数据 按行查看 历史
import { writeFileSync } from 'fs';
import { join } from 'path';
import { version } from './package.json';
import globals from 'globals';
// generate version.ts
const versionFilePath = join(__dirname, './src/version.ts');
writeFileSync(versionFilePath, `export const version = '${version}';`);
// generate globals.ts
const globalsFilePath = join(__dirname, './src/sandbox/globals.ts');
writeFileSync(
globalsFilePath,
`// generated from https://github.com/sindresorhus/globals/blob/main/globals.json es2015 part
// only init its values while Proxy is supported
export const globalsInES2015 = window.Proxy ? ${JSON.stringify(
Object.keys(globals.es2015),
null,
2,
)}.filter(p => /* just keep the available properties in current window context */ p in window) : [];
export const globalsInBrowser = ${JSON.stringify(Object.keys(globals.browser), null, 2)};
`,
);
export default {
target: 'browser',
esm: 'babel',
cjs: 'babel',
umd: {
minFile: true,
sourcemap: true,
},
runtimeHelpers: true,
extraBabelPlugins: [
[
'babel-plugin-import',
{
libraryName: 'lodash',
libraryDirectory: '',
camel2DashComponentName: false,
},
],
],
};
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化