From 2fcdb47fe5e312c7b334828eee7d2d6b9be1a46c Mon Sep 17 00:00:00 2001 From: orangemug Date: Tue, 9 Oct 2018 20:14:16 +0100 Subject: [PATCH] Moved babel config, removed uglifyJs and decorators plugins --- .babelrc | 22 ---------------------- config/webpack.loaders.js | 29 +++++++++++++++++------------ config/webpack.production.config.js | 2 -- package.json | 2 -- 4 files changed, 17 insertions(+), 38 deletions(-) delete mode 100644 .babelrc diff --git a/.babelrc b/.babelrc deleted file mode 100644 index c3f767b6..00000000 --- a/.babelrc +++ /dev/null @@ -1,22 +0,0 @@ -{ - "presets": ["@babel/preset-env", "@babel/preset-react"], - "plugins": [ - "react-hot-loader/babel", - "@babel/plugin-proposal-class-properties", - [ - "@babel/plugin-proposal-decorators", - { - "legacy": true - } - ], - ], - "env": { - "test": { - "plugins": [ - ["istanbul", { - "exclude": ["node_modules/**", "test/**"] - }] - ] - } - } -} diff --git a/config/webpack.loaders.js b/config/webpack.loaders.js index c4b0d4b8..496be43d 100644 --- a/config/webpack.loaders.js +++ b/config/webpack.loaders.js @@ -6,21 +6,26 @@ module.exports = [ exclude: [ path.resolve(__dirname, '../node_modules') ], - use: 'babel-loader' - }, - // HACK: This is a massive hack and reaches into the mapbox-gl private API. - // We have to include this for access to `normalizeSourceURL`. We should - // remove this ASAP, see - { - test: /\.jsx?$/, - include: [ - path.resolve(__dirname, '../node_modules/mapbox-gl/src/util/') - ], use: { loader: 'babel-loader', options: { - presets: ['@babel/preset-env', '@babel/preset-react', '@babel/preset-flow'], - plugins: ['@babel/plugin-transform-runtime', '@babel/plugin-proposal-class-properties'], + "presets": [ + "@babel/preset-env", + "@babel/preset-react" + ], + "plugins": [ + "react-hot-loader/babel", + "@babel/plugin-proposal-class-properties" + ], + "env": { + "test": { + "plugins": [ + ["istanbul", { + "exclude": ["node_modules/**", "test/**"] + }] + ] + } + } } } }, diff --git a/config/webpack.production.config.js b/config/webpack.production.config.js index 025040fe..41567bfe 100644 --- a/config/webpack.production.config.js +++ b/config/webpack.production.config.js @@ -6,7 +6,6 @@ var WebpackCleanupPlugin = require('webpack-cleanup-plugin'); var BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin; var CopyWebpackPlugin = require('copy-webpack-plugin'); var artifacts = require("../test/artifacts"); -var UglifyJsPlugin = require('uglifyjs-webpack-plugin'); var OUTPATH = artifacts.pathSync("/build"); @@ -41,7 +40,6 @@ module.exports = { NODE_ENV: '"production"' } }), - new UglifyJsPlugin(), new HtmlWebpackPlugin({ template: './src/template.html', title: 'Maputnik' diff --git a/package.json b/package.json index 33b41b22..0f6c7956 100644 --- a/package.json +++ b/package.json @@ -99,7 +99,6 @@ "devDependencies": { "@babel/core": "^7.1.2", "@babel/plugin-proposal-class-properties": "^7.1.0", - "@babel/plugin-proposal-decorators": "^7.1.2", "@babel/plugin-transform-runtime": "^7.1.0", "@babel/preset-env": "^7.1.0", "@babel/preset-flow": "^7.0.0", @@ -131,7 +130,6 @@ "stylelint-config-recommended-scss": "^3.2.0", "stylelint-scss": "^3.3.1", "transform-loader": "^0.2.4", - "uglifyjs-webpack-plugin": "^2.0.1", "uuid": "^3.3.2", "wdio-mocha-framework": "^0.6.3", "wdio-selenium-standalone-service": "0.0.10",