diff --git a/package.json b/package.json index bd557fb..fc61f03 100644 --- a/package.json +++ b/package.json @@ -18,34 +18,34 @@ }, "homepage": "https://github.com/tympanix/supper#readme", "devDependencies": { - "axios": "^0.17.1", - "babel-core": "^6.26.0", - "babel-loader": "^7.1.2", + "axios": "^0.18.0", + "babel-core": "^6.26.3", + "babel-loader": "^7.1.4", "babel-plugin-transform-class-properties": "^6.24.1", - "babel-preset-env": "^1.6.1", - "babel-preset-es2015": "^6.24.1", + "babel-preset-env": "^1.7.0", "babel-preset-react": "^6.24.1", - "css-loader": "^0.28.7", - "extract-text-webpack-plugin": "^3.0.2", - "file-loader": "^1.1.6", - "flag-icon-css": "^2.9.0", - "install": "^0.10.2", + "css-loader": "^0.28.11", + "file-loader": "^1.1.11", + "flag-icon-css": "^3.0.0", + "install": "^0.10.4", + "mini-css-extract-plugin": "^0.4.0", "miqu": "^0.1.0", - "node-sass": "^4.7.2", - "npm": "^5.6.0", - "react": "^16.2.0", - "react-dom": "^16.2.0", - "react-router": "^4.2.0", - "react-router-dom": "^4.2.2", + "node-sass": "^4.9.0", + "npm": "^5.10.0", + "react": "^16.4.0", + "react-dom": "^16.4.0", + "react-router": "^4.3.1", + "react-router-dom": "^4.3.1", "react-router-scroll-memory": "^1.0.1", - "react-tabs": "^2.1.1", - "react-transition-group": "^2.2.1", - "sass-loader": "^6.0.6", - "style-loader": "^0.19.1", - "svg-url-loader": "^2.3.1", - "uglifyjs-webpack-plugin": "^1.1.6", - "webpack": "^3.10.0", - "webpack-dev-server": "^2.9.7", - "webpack-merge": "^4.1.1" + "react-tabs": "^2.2.2", + "react-transition-group": "^2.3.1", + "sass-loader": "^6.0.7", + "style-loader": "^0.21.0", + "svg-url-loader": "^2.3.2", + "uglifyjs-webpack-plugin": "^1.2.5", + "webpack": "^4.12.0", + "webpack-cli": "^3.0.3", + "webpack-dev-server": "^3.1.4", + "webpack-merge": "^4.1.2" } } diff --git a/webpack.common.js b/webpack.common.js index 36f81fb..e0ab591 100644 --- a/webpack.common.js +++ b/webpack.common.js @@ -1,11 +1,8 @@ const path = require('path'); const webpack = require('webpack'); -const ExtractTextPlugin = require("extract-text-webpack-plugin"); +const MiniCssExtractPlugin = require("mini-css-extract-plugin"); -const extractSass = new ExtractTextPlugin({ - filename: "styles.css", - disable: process.env.NODE_ENV === "development" -}); +var devMode = process.env.NODE_ENV === "development" module.exports = { entry: './web/js/index.js', @@ -14,38 +11,36 @@ module.exports = { publicPath: "/static/", filename: 'bundle.js' }, + plugins: [ + new MiniCssExtractPlugin({ + filename: "styles.css", + }), + ], module: { rules: [ { test: /\.scss$/, - use: extractSass.extract({ - use: [ - { - loader: "css-loader" - }, { - loader: "sass-loader" - } - ], - // use style-loader in development - fallback: "style-loader" - }) + use: [ + devMode ? 'style-loader' : MiniCssExtractPlugin.loader, + 'css-loader', + 'sass-loader', + ], }, { test: /\.js$/, loader: 'babel-loader', query: { - presets: ['es2015', 'react'] + presets: ['env', 'react'] } }, { test: /\.svg$/, loader: 'file-loader', options: { - publicPath: './', - outputPath: 'img/', + publicPath: './img', + outputPath: './img', } } ] }, - plugins: [extractSass], stats: { colors: true }, diff --git a/webpack.dev.js b/webpack.dev.js index 5c4001d..e5eaf25 100644 --- a/webpack.dev.js +++ b/webpack.dev.js @@ -2,6 +2,7 @@ const merge = require('webpack-merge'); const common = require('./webpack.common.js'); module.exports = merge(common, { + mode: 'development', devtool: 'inline-source-map', devServer: { contentBase: 'web', diff --git a/webpack.prod.js b/webpack.prod.js index 778267a..1a3c22f 100644 --- a/webpack.prod.js +++ b/webpack.prod.js @@ -4,6 +4,7 @@ const UglifyJSPlugin = require('uglifyjs-webpack-plugin'); const common = require('./webpack.common.js'); module.exports = merge(common, { + mode: 'production', devtool: 'source-map', plugins: [ new UglifyJSPlugin({