Skip to content

Commit 088917d

Browse files
authored
Upgrade webpack (bvaughn#922)
1 parent dfb486e commit 088917d

File tree

6 files changed

+1402
-812
lines changed

6 files changed

+1402
-812
lines changed

package.json

Lines changed: 14 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
"build:types": "flow-copy-source --ignore \"**/*.{jest,example}.js\" source/WindowScroller dist/es/WindowScroller",
1414
"build": "npm run build:commonjs && npm run build:css && npm run build:es && npm run build:demo && npm run build:umd",
1515
"build:commonjs": "npm run clean:commonjs && cross-env NODE_ENV=production cross-env BABEL_ENV=commonjs babel source --out-dir dist/commonjs --ignore *.example.js,*.jest.js,source/demo/",
16-
"build:css": "postcss --config postcss.config.js --use autoprefixer source/styles.css > styles.css",
16+
"build:css": "postcss source/styles.css -o styles.css --use autoprefixer",
1717
"build:demo": "npm run clean:demo && cross-env NODE_ENV=production webpack --config webpack.config.demo.js -p --bail",
1818
"build:es": "npm run clean:es && npm run build:types && cross-env NODE_ENV=production cross-env BABEL_ENV=es babel source --out-dir dist/es --ignore *.example.js,*.jest.js,source/demo/",
1919
"build:umd": "npm run clean:umd && cross-env NODE_ENV=production webpack --config webpack.config.umd.js --bail",
@@ -32,7 +32,7 @@
3232
"prettier:diff": "prettier --list-different '{playground,source}/**/*.js'",
3333
"postpublish": "npm run deploy",
3434
"prepublish": "npm run build",
35-
"start": "cross-env NODE_ENV=development webpack-dev-server --hot --inline --config webpack.config.dev.js",
35+
"start": "webpack-dev-server --hot --config webpack.config.dev.js",
3636
"test": "npm run test:jest",
3737
"test:jest": "jest --no-watchman --runInBand",
3838
"test:ci": "jest --no-watchman --maxWorkers 2 --coverage && codecov",
@@ -89,12 +89,12 @@
8989
"verbose": true
9090
},
9191
"devDependencies": {
92-
"autoprefixer": "^6.2.3",
92+
"autoprefixer": "^7.2.3",
9393
"babel-cli": "^6.24.1",
9494
"babel-core": "^6.25.0",
9595
"babel-eslint": "^7.2.3",
9696
"babel-jest": "^22.0.4",
97-
"babel-loader": "6",
97+
"babel-loader": "7.1.2",
9898
"babel-plugin-__coverage__": "^11.0.0",
9999
"babel-plugin-flow-react-proptypes": "^12.1.0",
100100
"babel-plugin-react-transform": "^2.0.0",
@@ -110,7 +110,7 @@
110110
"codecov": "^2.2.0",
111111
"codemirror": "^5.18.0",
112112
"cross-env": "^5.0.1",
113-
"css-loader": "^0.28.4",
113+
"css-loader": "^0.28.7",
114114
"eslint": "^4.2.0",
115115
"eslint-config-fbjs": "^2.0.0",
116116
"eslint-config-prettier": "^2.3.0",
@@ -122,19 +122,19 @@
122122
"eslint-plugin-react": "^7.1.0",
123123
"eslint-plugin-relay": "^0.0.19",
124124
"express": "^4.13.3",
125-
"extract-text-webpack-plugin": "^3.0.0",
126-
"file-loader": "^0.11.2",
125+
"extract-text-webpack-plugin": "^3.0.2",
126+
"file-loader": "^1.1.6",
127127
"flow-bin": "^0.61.0",
128128
"flow-copy-source": "^1.2.1",
129129
"fs-extra": "^4.0.0",
130130
"gh-pages": "^1.0.0",
131-
"html-webpack-plugin": "^2.16.1",
131+
"html-webpack-plugin": "^2.30.1",
132132
"husky": "^0.14.3",
133133
"immutable": "^3.7.5",
134134
"jest": "^22.0.4",
135-
"postcss": "^5.0.14",
136-
"postcss-cli": "^2.3.3",
137-
"postcss-loader": "^0.9.1",
135+
"postcss": "^6.0.14",
136+
"postcss-cli": "^4.1.1",
137+
"postcss-loader": "^2.0.9",
138138
"prettier": "^1.5.3",
139139
"react": "^16.0.0",
140140
"react-codemirror": "^1.0.0",
@@ -145,11 +145,10 @@
145145
"react-transform-hmr": "^1.0.2",
146146
"redbox-react": "^1.4.3",
147147
"rimraf": "^2.4.3",
148-
"style-loader": "^0.13.0",
148+
"style-loader": "^0.19.1",
149149
"watch": "^1.0.2",
150-
"webpack": "^1.9.6",
151-
"webpack-dashboard": "^0.4.0",
152-
"webpack-dev-server": "^1.14.0"
150+
"webpack": "^3.10.0",
151+
"webpack-dev-server": "^2.9.7"
153152
},
154153
"dependencies": {
155154
"babel-runtime": "^6.23.0",

source/demo/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,4 @@ render(<Application />, document.getElementById('root'));
1414
// Import and attach the favicon
1515
document.querySelector(
1616
'[rel="shortcut icon"]',
17-
).href = require('file!./favicon.png');
17+
).href = require('file-loader!./favicon.png');

webpack.config.demo.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ module.exports = {
88
demo: './source/demo/index'
99
},
1010
output: {
11-
path: 'build',
11+
path: path.join(__dirname, 'build'),
1212
filename: 'static/[name].js'
1313
},
1414
plugins: [
@@ -24,20 +24,20 @@ module.exports = {
2424
})
2525
],
2626
module: {
27-
loaders: [
27+
rules: [
2828
{
2929
test: /\.js$/,
30-
loaders: ['babel'],
30+
use: ['babel-loader'],
3131
include: path.join(__dirname, 'source')
3232
},
3333
{
3434
test: /\.css$/,
35-
loaders: ['style', 'css?modules&importLoaders=1', 'postcss'],
35+
use: ['style-loader', 'css-loader?modules', 'postcss-loader'],
3636
include: path.join(__dirname, 'source')
3737
},
3838
{
3939
test: /\.css$/,
40-
loaders: ['style', 'css?importLoaders=1&minimize=false'],
40+
use: ['style-loader', 'css-loader?&minimize=false'],
4141
include: path.join(__dirname, 'styles.css')
4242
}
4343
]

webpack.config.dev.js

Lines changed: 9 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -2,58 +2,43 @@ const HtmlWebpackPlugin = require('html-webpack-plugin')
22
const path = require('path')
33
const webpack = require('webpack')
44

5-
const config = {
5+
module.exports = {
66
devtool: 'eval',
77
entry: {
88
demo: './source/demo/index'
99
},
1010
output: {
11-
path: 'build',
12-
filename: '/static/[name].js'
11+
path: path.join(__dirname, 'build'),
12+
filename: 'static/[name].js'
1313
},
1414
plugins: [
1515
new HtmlWebpackPlugin({
1616
filename: 'index.html',
1717
inject: true,
1818
template: './index.html'
19-
}),
20-
new webpack.NoErrorsPlugin(),
21-
new webpack.optimize.UglifyJsPlugin()
19+
})
2220
],
2321
module: {
24-
loaders: [
22+
rules: [
2523
{
2624
test: /\.js$/,
27-
loaders: ['babel'],
25+
use: ['babel-loader'],
2826
include: path.join(__dirname, 'source')
2927
},
3028
{
3129
test: /\.css$/,
32-
loaders: ['style', 'css?modules&importLoaders=1', 'postcss'],
30+
use: ['style-loader', 'css-loader?modules', 'postcss-loader'],
3331
include: path.join(__dirname, 'source')
3432
},
3533
{
3634
test: /\.css$/,
37-
loaders: ['style', 'css?importLoaders=1&minimize=false'],
35+
use: ['style-loader', 'css-loader?minimize=false'],
3836
include: path.join(__dirname, 'styles.css')
3937
}
4038
]
4139
},
4240
devServer: {
4341
contentBase: 'build',
44-
port: 3001,
45-
quiet: true
42+
port: 3001
4643
}
4744
}
48-
49-
if (process.env.NODE_ENV === 'development') {
50-
const Dashboard = require('webpack-dashboard')
51-
const DashboardPlugin = require('webpack-dashboard/plugin')
52-
const dashboard = new Dashboard()
53-
54-
config.plugins.push(
55-
new DashboardPlugin(dashboard.setData)
56-
)
57-
}
58-
59-
module.exports = config

webpack.config.umd.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ module.exports = {
77
'react-virtualized': './source/index.js'
88
},
99
output: {
10-
path: 'dist/umd',
10+
path: path.join(__dirname, 'dist/umd'),
1111
filename: '[name].js',
1212
libraryTarget: 'umd',
1313
library: 'ReactVirtualized'
@@ -24,10 +24,10 @@ module.exports = {
2424
})
2525
],
2626
module: {
27-
loaders: [
27+
rules: [
2828
{
2929
test: /\.js$/,
30-
loaders: ['babel'],
30+
use: ['babel-loader'],
3131
include: path.join(__dirname, 'source')
3232
}
3333
]

0 commit comments

Comments
 (0)