Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix lower target babel transpilation #127

Merged
merged 1 commit into from
Feb 19, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .browserslistrc
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
current node
node 12
last 2 versions and > 2%
ie > 10
13 changes: 1 addition & 12 deletions babel.config.js
Original file line number Diff line number Diff line change
@@ -1,16 +1,5 @@
const devPresets = ["@vue/babel-preset-app"];
const buildPresets = [
[
"@babel/preset-env",
// Config for @babel/preset-env
{
// Example: Always transpile optional chaining/nullish coalescing
// include: [
// /(optional-chaining|nullish-coalescing)/
// ],
},
],
];
const buildPresets = [["@babel/preset-env"]];
module.exports = {
presets: process.env.NODE_ENV === "development" ? devPresets : buildPresets,
};
22 changes: 1 addition & 21 deletions build/rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,18 +10,6 @@ import babel from "@rollup/plugin-babel";
import { terser } from "rollup-plugin-terser";
import minimist from "minimist";

// Get browserslist config and remove ie from es build targets
const esbrowserslist = fs
.readFileSync("./.browserslistrc")
.toString()
.split("\n")
.filter((entry) => entry && entry.substring(0, 2) !== "ie");

// Extract babel preset-env config, to combine with esbrowserslist
const babelPresetEnvConfig = require("../babel.config").presets.filter(
(entry) => entry[0] === "@babel/preset-env"
)[0][1];

const argv = minimist(process.argv.slice(2));

const projectRoot = path.resolve(__dirname, "..");
Expand Down Expand Up @@ -98,15 +86,7 @@ if (!argv.format || argv.format === "es") {
...baseConfig.plugins.postVue,
babel({
...baseConfig.plugins.babel,
presets: [
[
"@babel/preset-env",
{
...babelPresetEnvConfig,
targets: esbrowserslist,
},
],
],
presets: ["@babel/preset-env"],
}),
],
};
Expand Down