-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Jannik Zschiesche
committed
Jun 27, 2019
1 parent
0a8032a
commit c165914
Showing
4 changed files
with
45 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,9 @@ | ||
4.0.0 | ||
===== | ||
|
||
* Return environments (`legacy` and `modern`) instead of a single config. | ||
|
||
|
||
3.0.1 | ||
===== | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,34 @@ | ||
module.exports = { | ||
plugins: [ | ||
// ------------------------------------------------------------------------------------------ | ||
// Stage 3 proposals | ||
// ------------------------------------------------------------------------------------------ | ||
["@babel/plugin-syntax-dynamic-import"], | ||
["@babel/plugin-proposal-json-strings"], | ||
const browserslistConfigs = require("@becklyn/browserslist-config/envs"); | ||
|
||
/** | ||
* Builds the config for a given browser list | ||
*/ | ||
function buildConfig (browserslistConfig) | ||
{ | ||
return { | ||
plugins: [ | ||
// ------------------------------------------------------------------------------------------ | ||
// Stage 3 proposals | ||
// ------------------------------------------------------------------------------------------ | ||
["@babel/plugin-syntax-dynamic-import"], | ||
["@babel/plugin-proposal-json-strings"], | ||
|
||
// set with loose: true, as the compilation is pretty big | ||
// https://babeljs.io/docs/plugins/transform-class-properties/ | ||
["@babel/plugin-proposal-class-properties", {loose: true}], | ||
// set with loose: true, as the compilation is pretty big | ||
// https://babeljs.io/docs/plugins/transform-class-properties/ | ||
["@babel/plugin-proposal-class-properties", {loose: true}], | ||
|
||
// default env | ||
["@babel/preset-env", { | ||
spec: false, | ||
useBuiltIns: "entry", | ||
corejs: 3, | ||
}], | ||
] | ||
// default env | ||
["@babel/preset-env", { | ||
spec: false, | ||
useBuiltIns: "entry", | ||
corejs: 3, | ||
targets: browserslistConfig, | ||
}], | ||
], | ||
}; | ||
} | ||
|
||
module.exports = { | ||
modern: buildConfig(browserslistConfigs.modern), | ||
legacy: buildConfig(browserslistConfigs.legacy), | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters