Moved babel config, removed uglifyJs and decorators plugins

This commit is contained in:
orangemug
2018-10-09 20:14:16 +01:00
parent 012e4b670e
commit 2fcdb47fe5
4 changed files with 17 additions and 38 deletions

View File

@@ -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 <https://github.com/mapbox/mapbox-gl-js/issues/2416>
{
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/**"]
}]
]
}
}
}
}
},

View File

@@ -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'