Skip to content

Commit 958e495

Browse files
committed
update deps and fix config for webpack 2 updates
1 parent e7bc634 commit 958e495

6 files changed

+30
-21
lines changed

build/vue-loader.config.js

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
module.exports = {
2+
postcss: [
3+
require('autoprefixer')({
4+
browsers: ['last 3 versions']
5+
})
6+
]
7+
}

build/webpack.base.config.js

+7-10
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
const path = require('path')
2+
const webpack = require('webpack')
3+
const vueConfig = require('./vue-loader.config')
24

35
module.exports = {
46
devtool: '#source-map',
@@ -11,9 +13,6 @@ module.exports = {
1113
publicPath: '/dist/',
1214
filename: 'client-bundle.js'
1315
},
14-
resolveLoader: {
15-
root: path.join(__dirname, '../node_modules'),
16-
},
1716
module: {
1817
loaders: [
1918
{
@@ -35,11 +34,9 @@ module.exports = {
3534
}
3635
]
3736
},
38-
vue: {
39-
postcss: [
40-
require('autoprefixer')({
41-
browsers: ['last 3 versions']
42-
})
43-
]
44-
}
37+
plugins: [
38+
new webpack.LoaderOptionsPlugin({
39+
vue: vueConfig
40+
})
41+
]
4542
}

build/webpack.client.config.js

+11-6
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
1-
const base = require('./webpack.base.config')
21
const webpack = require('webpack')
2+
const base = require('./webpack.base.config')
3+
const vueConfig = require('./vue-loader.config')
34

45
const config = Object.assign({}, base, {
5-
plugins: [
6+
plugins: base.plugins.concat([
67
// strip comments in Vue code
78
new webpack.DefinePlugin({
89
'process.env.NODE_ENV': JSON.stringify(process.env.NODE_ENV || 'development')
@@ -12,17 +13,21 @@ const config = Object.assign({}, base, {
1213
name: 'vendor',
1314
filename: 'client-vendor-bundle.js'
1415
})
15-
]
16+
])
1617
})
1718

1819
if (process.env.NODE_ENV === 'production') {
19-
// extract CSS into a single file so it's applied on initial render
20+
// Use ExtractTextPlugin to extract CSS into a single file
21+
// so it's applied on initial render
2022
const ExtractTextPlugin = require('extract-text-webpack-plugin')
2123

22-
config.vue.loaders = {
24+
// vueConfig is already included in the config via LoaderOptionsPlugin
25+
// here we overwrite the loader config for <style lang="stylus">
26+
// so they are extracted.
27+
vueConfig.loaders = {
2328
stylus: ExtractTextPlugin.extract({
2429
loader: "css-loader!stylus-loader",
25-
fallbackLoader: "vue-style-loader"
30+
fallbackLoader: "vue-style-loader" // <- this is a dep of vue-loader
2631
})
2732
}
2833

build/webpack.server.config.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ const base = require('./webpack.base.config')
33

44
module.exports = Object.assign({}, base, {
55
target: 'node',
6-
devtool: null,
6+
devtool: false,
77
entry: './src/server-entry.js',
88
output: Object.assign({}, base.output, {
99
filename: 'server-bundle.js',

package.json

+3-3
Original file line numberDiff line numberDiff line change
@@ -30,13 +30,13 @@
3030
"babel-preset-es2015": "^6.13.2",
3131
"babel-preset-stage-2": "^6.11.0",
3232
"cross-env": "^2.0.0",
33-
"css-loader": "^0.23.1",
33+
"css-loader": "^0.25.0",
3434
"extract-text-webpack-plugin": "^2.0.0-beta.3",
35-
"file-loader": "^0.8.4",
35+
"file-loader": "^0.9.0",
3636
"stylus": "^0.54.5",
3737
"stylus-loader": "^2.1.2",
3838
"url-loader": "^0.5.7",
39-
"vue-loader": "^9.2.2",
39+
"vue-loader": "^9.5.0",
4040
"webpack": "^2.1.0-beta.20",
4141
"webpack-dev-middleware": "^1.6.1",
4242
"webpack-hot-middleware": "^2.12.2"

server.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ app.use(favicon(resolve('./src/assets/logo.png')))
5151

5252
app.get('*', (req, res) => {
5353
if (!renderer) {
54-
return res.end('waiting for compilation...')
54+
return res.end('waiting for compilation... refresh in a moment.')
5555
}
5656

5757
var s = Date.now()

0 commit comments

Comments
 (0)