Skip to content

Commit

Permalink
Fixed babel transpilation of jsesc and crypto-api
Browse files Browse the repository at this point in the history
  • Loading branch information
n1474335 committed Nov 21, 2018
1 parent d6604e0 commit cc35ec8
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 21 deletions.
19 changes: 0 additions & 19 deletions .babelrc

This file was deleted.

2 changes: 1 addition & 1 deletion Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ module.exports = function (grunt) {
options: {
configFile: "./.eslintrc.json"
},
configs: ["Gruntfile.js"],
configs: ["*.js"],
core: ["src/core/**/*.{js,mjs}", "!src/core/vendor/**/*", "!src/core/operations/legacy/**/*"],
web: ["src/web/**/*.{js,mjs}"],
node: ["src/node/**/*.{js,mjs}"],
Expand Down
23 changes: 23 additions & 0 deletions babel.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
module.exports = function(api) {
api.cache.forever();

return {
"presets": [
["@babel/preset-env", {
"targets": {
"chrome": 40,
"firefox": 35,
"edge": 14,
"node": "6.5"
},
"modules": false,
"useBuiltIns": "entry"
}]
],
"plugins": [
["babel-plugin-transform-builtin-extend", {
"globals": ["Error"]
}]
]
};
};
8 changes: 7 additions & 1 deletion webpack.config.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
const webpack = require("webpack");
const ExtractTextPlugin = require("extract-text-webpack-plugin");
const path = require("path");

/**
* Webpack configuration details for use with Grunt.
Expand Down Expand Up @@ -58,8 +59,13 @@ module.exports = {
{
test: /\.m?js$/,
exclude: /node_modules\/(?!jsesc|crypto-api)/,
options: {
configFile: path.resolve(__dirname, "babel.config.js"),
cacheDirectory: true,
compact: false
},
type: "javascript/auto",
loader: "babel-loader?compact=false"
loader: "babel-loader"
},
{
test: /forge.min.js$/,
Expand Down

0 comments on commit cc35ec8

Please sign in to comment.