代码拉取完成,页面将自动刷新
同步操作将从 antv/L7 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
// @see https://babeljs.io/docs/en/next/config-files#project-wide-configuration
module.exports = api => {
api.cache(() => process.env.NODE_ENV);
const isSite = api.env('site');
const isCDNBundle = api.env('bundle');
const isCommonJS = api.env('cjs');
const isESModule = api.env('esm');
const isTest = api.env('test');
if (isSite) {
return {
presets: [
'babel-preset-gatsby'
],
plugins: [
'@babel/plugin-proposal-optional-chaining',
'@babel/plugin-proposal-nullish-coalescing-operator',
'transform-inline-environment-variables',
[
'@babel/plugin-proposal-decorators',
{
legacy: true
}
],
[
// import glsl as raw text
'babel-plugin-inline-import',
{
extensions: [
// 由于使用了 TS 的 resolveJsonModule 选项,JSON 可以直接引入,不需要当作纯文本
'.pbf',
'.glsl'
]
}
]
]
};
}
return {
presets: [
[
'@babel/env',
{
// https://babeljs.io/docs/en/babel-preset-env#usebuiltins
// useBuiltIns: 'usage',
...isCDNBundle ? { corejs: '3.0.0' } : {},
useBuiltIns: isCDNBundle ? 'usage' : false,
// set `modules: false` when building CDN bundle, let rollup do commonjs works
// @see https://github.com/rollup/rollup-plugin-babel#modules
modules: (isCDNBundle || isESModule) ? false : 'auto',
targets: {
chrome: 58,
browsers: [ 'ie >= 11' ]
}
}
],
[
'@babel/preset-react',
{
development: isCommonJS
}
],
'@babel/preset-typescript'
],
plugins: [
isCDNBundle ? {} : '@babel/plugin-transform-runtime',
'@babel/plugin-proposal-object-rest-spread',
'@babel/plugin-proposal-optional-chaining',
'@babel/plugin-proposal-nullish-coalescing-operator',
'@babel/plugin-syntax-async-generators',
// '@babel/plugin-transform-parameters',
'transform-node-env-inline',
[
'@babel/plugin-proposal-decorators',
{
legacy: true
}
],
[
'@babel/plugin-proposal-class-properties',
{
// @see https://github.com/storybookjs/storybook/issues/6069#issuecomment-472544973
loose: true
}
],
'@babel/plugin-syntax-dynamic-import',
// let rollup do commonjs works
// @see https://github.com/rollup/rollup-plugin-babel#modules
(isCDNBundle || isESModule) ? {} : '@babel/plugin-transform-modules-commonjs',
// 开发模式下以原始文本引入,便于调试
isCDNBundle ? {} : [
// import glsl as raw text
'babel-plugin-inline-import',
{
extensions: [
// 由于使用了 TS 的 resolveJsonModule 选项,JSON 可以直接引入,不需要当作纯文本
// '.json',
'.glsl'
]
}
],
isCDNBundle ? {} : [
'transform-import-styles'
],
[
// @see https://github.com/babel/babel/issues/8741#issuecomment-509041135
'const-enum',
{
transform: 'constObject'
}
],
// 按需引用 @see https://github.com/lodash/babel-plugin-lodash
'lodash'
// 内联 WebGL 常量 @see https://www.npmjs.com/package/babel-plugin-inline-webgl-constants
// isCDNBundle ? 'inline-webgl-constants' : {},
],
ignore: [
// /node_modules\/(?![kdbush|supercluster|async])/,
'node_modules',
...!isTest ? [
'**/*.test.tsx',
'**/*.test.ts',
'**/*.story.tsx',
'__snapshots__',
'__tests__',
'__stories__',
'**/*/__snapshots__',
'**/*/__tests__'
] : []
]
};
};
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。