Skip to content

Commit

Permalink
Use @babel/preset-env
Browse files Browse the repository at this point in the history
The yearly presets like preset-es2015 are deprecated, and the best
practice is to use @babel/preset-env nowadays.

Ref. #27.
Closes #30.
  • Loading branch information
mathiasbynens authored Dec 11, 2017
1 parent 5442220 commit bf0edd6
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 4 deletions.
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,10 @@
},
"license": "BSD-3-Clause",
"dependencies": {
"@babel/standalone": "7.0.0-beta.32",
"@babel/core": "^7.0.0-beta.34",
"@babel/preset-env": "^7.0.0-beta.34",
"acorn": "5.2.1",
"babylon": "7.0.0-beta.32",
"babylon": "7.0.0-beta.34",
"benchmark": "^2.1.4",
"buble": "0.17.3",
"chai": "4.1.2",
Expand Down
17 changes: 15 additions & 2 deletions src/babel-benchmark.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,27 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

const Babel = require("@babel/standalone");
const Babel = require("@babel/core");
const babylon = require("babylon");
const fs = require("fs");

const payloads = [
{
name: "vue.runtime.esm-nobuble-2.4.4.js",
options: { presets: ["es2015"], sourceType: "module" }
options: {
presets: [
[
"@babel/preset-env",
{
targets: {
browsers: ["last 2 versions"],
node: 4 // https://github.com/nodejs/Release#release-schedule
}
}
]
],
sourceType: "module"
}
}
].map(({ name, options }) => {
const code = fs.readFileSync(`third_party/${name}`, "utf8");
Expand Down

0 comments on commit bf0edd6

Please sign in to comment.