Skip to content

Commit

Permalink
Merge pull request #408 from orangemug/maintenance/update-deps-2018-1…
Browse files Browse the repository at this point in the history
…0-06

Updated dependencies
  • Loading branch information
orangemug authored Oct 10, 2018
2 parents a666f86 + 843d3df commit 90024c5
Show file tree
Hide file tree
Showing 36 changed files with 6,542 additions and 6,436 deletions.
12 changes: 9 additions & 3 deletions .babelrc
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
{
"presets": ["env", "react"],
"plugins": ["transform-object-rest-spread", "transform-class-properties"],
"presets": [
"@babel/preset-env",
"@babel/preset-react"
],
"plugins": [
"react-hot-loader/babel",
"@babel/plugin-proposal-class-properties"
],
"env": {
"test": {
"plugins": [
Expand All @@ -10,4 +16,4 @@
]
}
}
}
}
5 changes: 3 additions & 2 deletions config/webpack.config.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"use strict";
var webpack = require('webpack');
var path = require('path');
var loaders = require('./webpack.loaders');
var rules = require('./webpack.rules');
var HtmlWebpackPlugin = require('html-webpack-plugin');
var CopyWebpackPlugin = require('copy-webpack-plugin');

Expand All @@ -10,6 +10,7 @@ const PORT = process.env.PORT || "8888";

module.exports = {
target: 'web',
mode: 'development',
entry: [
`webpack-dev-server/client?http://${HOST}:${PORT}`,
`webpack/hot/only-dev-server`,
Expand All @@ -27,7 +28,7 @@ module.exports = {
noParse: [
/mapbox-gl\/dist\/mapbox-gl.js/
],
loaders: loaders
rules: rules
},
node: {
fs: "empty",
Expand Down
55 changes: 0 additions & 55 deletions config/webpack.loaders.js

This file was deleted.

18 changes: 6 additions & 12 deletions config/webpack.production.config.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
var webpack = require('webpack');
var path = require('path');
var loaders = require('./webpack.loaders');
var ExtractTextPlugin = require('extract-text-webpack-plugin');
var rules = require('./webpack.rules');
var HtmlWebpackPlugin = require('html-webpack-plugin');
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");

Expand All @@ -17,8 +15,8 @@ module.exports = {
},
output: {
path: OUTPATH,
filename: '[name].[chunkhash].js',
chunkFilename: '[chunkhash].js'
filename: '[name].[contenthash].js',
chunkFilename: '[contenthash].js'
},
resolve: {
extensions: ['.js', '.jsx']
Expand All @@ -27,7 +25,7 @@ module.exports = {
noParse: [
/mapbox-gl\/dist\/mapbox-gl.js/
],
loaders
rules: rules
},
node: {
fs: "empty",
Expand All @@ -42,10 +40,6 @@ module.exports = {
NODE_ENV: '"production"'
}
}),
new UglifyJsPlugin(),
new ExtractTextPlugin('[contenthash].css', {
allChunks: true
}),
new HtmlWebpackPlugin({
template: './src/template.html',
title: 'Maputnik'
Expand All @@ -54,8 +48,8 @@ module.exports = {
{
from: './src/manifest.json',
to: 'manifest.json'
}
]),
}
]),
new BundleAnalyzerPlugin({
analyzerMode: 'static',
defaultSizes: 'gzip',
Expand Down
38 changes: 38 additions & 0 deletions config/webpack.rules.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
const path = require("path");

module.exports = [
{
test: /\.jsx?$/,
exclude: [
path.resolve(__dirname, '../node_modules')
],
use: 'babel-loader'
},
{
test: /\.(eot|ttf|woff|woff2)$/,
use: 'file-loader?name=fonts/[name].[ext]'
},
{
test: /\.ico$/,
use: 'file-loader?name=[name].[ext]'
},
{
test: /\.(svg|gif|jpg|png)$/,
use: 'file-loader?name=img/[name].[ext]'
},
{
test: /[\/\\](node_modules|global|src)[\/\\].*\.scss$/,
use: [
'style-loader',
"css-loader",
"sass-loader"
]
},
{
test: /[\/\\](node_modules|global|src)[\/\\].*\.css$/,
use: [
'style-loader',
'css-loader'
]
}
];
Loading

0 comments on commit 90024c5

Please sign in to comment.