From cc35ec82eba7bd73dfa7cf9e3bff5cff73a9cef3 Mon Sep 17 00:00:00 2001 From: n1474335 Date: Wed, 21 Nov 2018 17:47:56 +0000 Subject: [PATCH] Fixed babel transpilation of jsesc and crypto-api --- .babelrc | 19 ------------------- Gruntfile.js | 2 +- babel.config.js | 23 +++++++++++++++++++++++ webpack.config.js | 8 +++++++- 4 files changed, 31 insertions(+), 21 deletions(-) delete mode 100644 .babelrc create mode 100644 babel.config.js diff --git a/.babelrc b/.babelrc deleted file mode 100644 index 451186bd..00000000 --- a/.babelrc +++ /dev/null @@ -1,19 +0,0 @@ -{ - "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"] - }] - ] -} diff --git a/Gruntfile.js b/Gruntfile.js index 4683d4c1..aee50b75 100755 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -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}"], diff --git a/babel.config.js b/babel.config.js new file mode 100644 index 00000000..2362c42a --- /dev/null +++ b/babel.config.js @@ -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"] + }] + ] + }; +}; diff --git a/webpack.config.js b/webpack.config.js index bbf3ee77..3e0412be 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -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. @@ -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$/,