Skip to content

Commit 2540cf7

Browse files
author
Ryan.Chang
committed
Upgrade to webpack 3
1 parent 37ce4ab commit 2540cf7

File tree

2 files changed

+21
-12
lines changed

2 files changed

+21
-12
lines changed

package.json

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,12 @@
2323
},
2424
"devDependencies": {
2525
"clean-webpack-plugin": "^0.1.3",
26-
"css-loader": "^0.16.0",
27-
"extract-text-webpack-plugin": "^0.8.2",
28-
"file-loader": "^0.8.4",
29-
"html-webpack-plugin": "^1.6.1",
30-
"style-loader": "^0.12.3",
31-
"webpack": "^1.12.2",
32-
"webpack-dev-server": "^1.11.0"
26+
"css-loader": "^0.28.7",
27+
"extract-text-webpack-plugin": "^3.0.2",
28+
"file-loader": "^1.1.5",
29+
"html-webpack-plugin": "^2.30.1",
30+
"style-loader": "^0.19.0",
31+
"webpack": "^3.8.1",
32+
"webpack-dev-server": "^2.9.2"
3333
}
3434
}

webpack-config.js

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,33 @@
1+
var {resolve} = require('path');
12
var Clean = require('clean-webpack-plugin');
23
var ExtractTextPlugin = require('extract-text-webpack-plugin');
34
var HtmlWebpackPlugin = require('html-webpack-plugin');
45

56
module.exports = {
67
entry: {
7-
main: './index.js'
8+
main: resolve('./index.js'),
89
},
910
output: {
10-
path: './dist',
11+
path: resolve('./dist'),
1112
filename: 'app.[hash].js'
1213
},
1314
module: {
14-
loaders: [
15+
rules: [
1516
{
1617
test: /\.css$/,
17-
loader: ExtractTextPlugin.extract("style-loader", "css-loader")
18+
loader: ExtractTextPlugin.extract({
19+
fallback: "style-loader",
20+
use: {
21+
loader: "css-loader",
22+
options: {
23+
minimize: false,
24+
},
25+
},
26+
})
1827
},
1928
{
2029
test: /\.(jpg|png)$/,
21-
loader: 'file'
30+
loader: 'file-loader'
2231
},
2332
]
2433
},

0 commit comments

Comments
 (0)