1 Star 0 Fork 0

ChengzeHsiao/marktext

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
babel.config.js 1.39 KB
一键复制 编辑 原始数据 按行查看 历史
Ran Luo 提交于 2019-09-01 03:30 . Update Babel to 7.x.x (#1253)
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': 10 }
}]
],
main: [
[presetEnv,
{
targets: { 'node': 10 }
}]
],
renderer: [
[presetEnv,
{
useBuiltIns: false,
targets: {
electron: require('electron/package.json').version,
node: 10
}
}]
]
}
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/hugo_code/marktext.git
git@gitee.com:hugo_code/marktext.git
hugo_code
marktext
marktext
develop

搜索帮助