1 Star 0 Fork 39

小小晨/Mark-Text

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
babel.config.js 1.39 KB
一键复制 编辑 原始数据 按行查看 历史
Felix Häusler 提交于 2022-01-02 11:48 . Update build tools (#2814)
const proposalClassProperties = require('@babel/plugin-proposal-class-properties')
const syntaxClassProperties = require('@babel/plugin-syntax-class-properties')
const transformRuntime = require('@babel/plugin-transform-runtime')
const syntaxDynamicImport = require('@babel/plugin-syntax-dynamic-import')
const functionBind = require('@babel/plugin-proposal-function-bind')
const exportDefault = require('@babel/plugin-proposal-export-default-from')
const isTanbul = require('babel-plugin-istanbul')
const component = require('babel-plugin-component')
const presetEnv = require('@babel/preset-env')
const presetsHash = {
test: [
[presetEnv,
{
targets: { 'node': 16 }
}]
],
main: [
[presetEnv,
{
targets: { 'node': 16 }
}]
],
renderer: [
[presetEnv,
{
useBuiltIns: false,
targets: {
electron: require('electron/package.json').version,
node: 16
}
}]
]
}
module.exports = function (api) {
const plugins = [ proposalClassProperties, syntaxClassProperties, transformRuntime, syntaxDynamicImport, functionBind, exportDefault ]
const env = api.env()
const presets = presetsHash[env]
if (env === 'test') {
plugins.push(isTanbul)
} else if (env === 'renderer') {
plugins.push(
[component, {
style: false,
libraryName: 'element-ui'
}
])
}
return {
presets,
plugins
}
}
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/fangXiaoXiaoChen/Mark-Text.git
git@gitee.com:fangXiaoXiaoChen/Mark-Text.git
fangXiaoXiaoChen
Mark-Text
Mark-Text
master

搜索帮助

0d507c66 1850385 C8b1a773 1850385