Skip to content
This repository has been archived by the owner on Aug 19, 2022. It is now read-only.

Commit

Permalink
Webpack 4 upgrade
Browse files Browse the repository at this point in the history
  • Loading branch information
Kyle Cesmat committed Sep 29, 2020
1 parent f06f28f commit 2bf9e57
Show file tree
Hide file tree
Showing 6 changed files with 1,036 additions and 1,680 deletions.
1 change: 1 addition & 0 deletions examples/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
var path = require('path'); // eslint-disable-line no-var

module.exports = {
mode: 'production',
cache: true,
entry: {
app: './examples/client.js'
Expand Down
4 changes: 2 additions & 2 deletions karma.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,12 @@ module.exports = function(config) {
'src/__tests__/**/*.js': ['webpack']
},
webpack: {
cache: true,
mode: 'development',
cache: false,
module: {
rules: [
{
test: /\.js$/,
enforce: 'pre',
include: path.resolve('src/'),
loader: 'babel-loader'
},
Expand Down
15 changes: 8 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -63,14 +63,15 @@
"@babel/preset-flow": "^7.10.4",
"@babel/preset-react": "^7.10.4",
"babel-loader": "^8.1.0",
"builder": "^3.2.3",
"builder": "^5.0.0",
"exenv": "^1.2.2",
"hoist-non-react-statics": "3.3.2",
"inline-style-prefixer": "^4.0.0",
"prop-types": "^15.7.2",
"publishr": "^1.0.0",
"rimraf": "^2.6.1",
"webpack": "^3.10.0"
"rimraf": "^3.0.2",
"webpack": "^4.44.2",
"webpack-cli": "^3.3.12"
},
"peerDependencies": {
"react": "^16.8.0"
Expand All @@ -97,15 +98,15 @@
"inject-loader": "^3.0.1",
"jsdom": "^12.0.0",
"jsdom-global": "^3.0.2",
"karma": "^3.0.0",
"karma-babel-preprocessor": "^6.0.1",
"karma-chrome-launcher": "^2.2.0",
"karma": "^5.2.3",
"karma-babel-preprocessor": "^8.0.1",
"karma-chrome-launcher": "^3.1.0",
"karma-coverage": "^1.1.1",
"karma-ie-launcher": "^1.0.0",
"karma-mocha": "^1.3.0",
"karma-mocha-reporter": "^2.2.2",
"karma-sinon-chai": "^1.2.4",
"karma-webpack": "^2.0.3",
"karma-webpack": "^4.0.2",
"mocha": "4",
"node-libs-browser": "^2.2.1",
"nodemon": "^2.0.4",
Expand Down
4 changes: 4 additions & 0 deletions webpack.config.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
const path = require('path');

module.exports = {
mode: 'production',
cache: true,
entry: path.join(__dirname, 'src/index.js'),
optimization: {
minimize: false
},
externals: [
{
react: {
Expand Down
17 changes: 2 additions & 15 deletions webpack.config.minified.js
Original file line number Diff line number Diff line change
@@ -1,21 +1,8 @@
const webpack = require('webpack');
const base = require('./webpack.config');

module.exports = Object.assign({}, base, {
mode: 'production',
output: Object.assign({}, base.output, {
filename: 'radium.min.js'
}),
plugins: [].concat(base.plugins || [], [
new webpack.optimize.UglifyJsPlugin({
compress: {
warnings: false
}
}),
new webpack.DefinePlugin({
'process.env': {
// Signal production mode for React JS and other libs.
NODE_ENV: JSON.stringify('production')
}
})
])
})
});
Loading

0 comments on commit 2bf9e57

Please sign in to comment.