@quasar/babel-preset-app
Advanced tools
Comparing version 1.0.0-alpha.4 to 1.0.0-alpha.5
53
index.js
const path = require('path') | ||
module.exports = (context, opts) => { | ||
const presetEnvOptions = { | ||
const presetEnv = { | ||
modules: false, | ||
@@ -10,8 +10,35 @@ loose: false, | ||
if (opts.presetEnvOptions !== void 0) { | ||
Object.assign(presetEnv, opts.presetEnvOptions) | ||
if (opts !== void 0 && opts.presetEnv !== void 0) { | ||
Object.assign(presetEnv, opts.presetEnv) | ||
} | ||
const pluginTransformRuntime = { | ||
regenerator: true, | ||
corejs: presetEnv.useBuiltIns !== false ? false : 2, | ||
helpers: presetEnv.useBuiltIns === 'usage', | ||
absoluteRuntime: path.dirname(require.resolve('@babel/runtime/package.json')) | ||
} | ||
const pluginProposalDecorators = { | ||
legacy: true | ||
} | ||
const pluginProposalClassProperties = { | ||
loose: false | ||
} | ||
if (opts !== void 0) { | ||
if (opts.pluginTransformRuntime) { | ||
Object.assign(pluginTransformRuntime, opts.pluginTransformRuntime) | ||
} | ||
if (opts.pluginProposalDecorators) { | ||
Object.assign(pluginProposalDecorators, opts.pluginProposalDecorators) | ||
} | ||
if (opts.pluginProposalClassProperties) { | ||
Object.assign(pluginProposalClassProperties, opts.pluginProposalClassProperties) | ||
} | ||
} | ||
const presets = [ | ||
[ require('@babel/preset-env'), presetEnvOptions ] | ||
[ require('@babel/preset-env'), presetEnv ] | ||
] | ||
@@ -22,5 +49,4 @@ | ||
[ | ||
require('@babel/plugin-proposal-decorators'), { | ||
legacy: true | ||
} | ||
require('@babel/plugin-proposal-decorators'), | ||
pluginProposalDecorators | ||
], | ||
@@ -36,5 +62,4 @@ require('@babel/plugin-proposal-function-sent'), | ||
[ | ||
require('@babel/plugin-proposal-class-properties'), { | ||
loose: false | ||
} | ||
require('@babel/plugin-proposal-class-properties'), | ||
pluginProposalClassProperties | ||
], | ||
@@ -45,8 +70,4 @@ require('@babel/plugin-proposal-json-strings'), | ||
[ | ||
require('@babel/plugin-transform-runtime'), { | ||
regenerator: presetEnvOptions.useBuiltIns !== 'usage', | ||
corejs: presetEnvOptions.useBuiltIns !== false ? false : 2, | ||
helpers: presetEnvOptions.useBuiltIns === 'usage', | ||
absoluteRuntime: path.dirname(require.resolve('@babel/runtime/package.json')) | ||
} | ||
require('@babel/plugin-transform-runtime'), | ||
pluginTransformRuntime | ||
] | ||
@@ -53,0 +74,0 @@ ] |
{ | ||
"name": "@quasar/babel-preset-app", | ||
"version": "1.0.0-alpha.4", | ||
"version": "1.0.0-alpha.5", | ||
"description": "Babel preset for Quasar CLI", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
56561
65