Commit 958e4953 authored by Evan You's avatar Evan You

update deps and fix config for webpack 2 updates

parent e7bc634c
module.exports = {
postcss: [
require('autoprefixer')({
browsers: ['last 3 versions']
})
]
}
const path = require('path') const path = require('path')
const webpack = require('webpack')
const vueConfig = require('./vue-loader.config')
module.exports = { module.exports = {
devtool: '#source-map', devtool: '#source-map',
...@@ -11,9 +13,6 @@ module.exports = { ...@@ -11,9 +13,6 @@ module.exports = {
publicPath: '/dist/', publicPath: '/dist/',
filename: 'client-bundle.js' filename: 'client-bundle.js'
}, },
resolveLoader: {
root: path.join(__dirname, '../node_modules'),
},
module: { module: {
loaders: [ loaders: [
{ {
...@@ -35,11 +34,9 @@ module.exports = { ...@@ -35,11 +34,9 @@ module.exports = {
} }
] ]
}, },
vue: { plugins: [
postcss: [ new webpack.LoaderOptionsPlugin({
require('autoprefixer')({ vue: vueConfig
browsers: ['last 3 versions']
}) })
] ]
}
} }
const base = require('./webpack.base.config')
const webpack = require('webpack') const webpack = require('webpack')
const base = require('./webpack.base.config')
const vueConfig = require('./vue-loader.config')
const config = Object.assign({}, base, { const config = Object.assign({}, base, {
plugins: [ plugins: base.plugins.concat([
// strip comments in Vue code // strip comments in Vue code
new webpack.DefinePlugin({ new webpack.DefinePlugin({
'process.env.NODE_ENV': JSON.stringify(process.env.NODE_ENV || 'development') 'process.env.NODE_ENV': JSON.stringify(process.env.NODE_ENV || 'development')
...@@ -12,17 +13,21 @@ const config = Object.assign({}, base, { ...@@ -12,17 +13,21 @@ const config = Object.assign({}, base, {
name: 'vendor', name: 'vendor',
filename: 'client-vendor-bundle.js' filename: 'client-vendor-bundle.js'
}) })
] ])
}) })
if (process.env.NODE_ENV === 'production') { if (process.env.NODE_ENV === 'production') {
// extract CSS into a single file so it's applied on initial render // Use ExtractTextPlugin to extract CSS into a single file
// so it's applied on initial render
const ExtractTextPlugin = require('extract-text-webpack-plugin') const ExtractTextPlugin = require('extract-text-webpack-plugin')
config.vue.loaders = { // vueConfig is already included in the config via LoaderOptionsPlugin
// here we overwrite the loader config for <style lang="stylus">
// so they are extracted.
vueConfig.loaders = {
stylus: ExtractTextPlugin.extract({ stylus: ExtractTextPlugin.extract({
loader: "css-loader!stylus-loader", loader: "css-loader!stylus-loader",
fallbackLoader: "vue-style-loader" fallbackLoader: "vue-style-loader" // <- this is a dep of vue-loader
}) })
} }
......
...@@ -3,7 +3,7 @@ const base = require('./webpack.base.config') ...@@ -3,7 +3,7 @@ const base = require('./webpack.base.config')
module.exports = Object.assign({}, base, { module.exports = Object.assign({}, base, {
target: 'node', target: 'node',
devtool: null, devtool: false,
entry: './src/server-entry.js', entry: './src/server-entry.js',
output: Object.assign({}, base.output, { output: Object.assign({}, base.output, {
filename: 'server-bundle.js', filename: 'server-bundle.js',
......
...@@ -30,13 +30,13 @@ ...@@ -30,13 +30,13 @@
"babel-preset-es2015": "^6.13.2", "babel-preset-es2015": "^6.13.2",
"babel-preset-stage-2": "^6.11.0", "babel-preset-stage-2": "^6.11.0",
"cross-env": "^2.0.0", "cross-env": "^2.0.0",
"css-loader": "^0.23.1", "css-loader": "^0.25.0",
"extract-text-webpack-plugin": "^2.0.0-beta.3", "extract-text-webpack-plugin": "^2.0.0-beta.3",
"file-loader": "^0.8.4", "file-loader": "^0.9.0",
"stylus": "^0.54.5", "stylus": "^0.54.5",
"stylus-loader": "^2.1.2", "stylus-loader": "^2.1.2",
"url-loader": "^0.5.7", "url-loader": "^0.5.7",
"vue-loader": "^9.2.2", "vue-loader": "^9.5.0",
"webpack": "^2.1.0-beta.20", "webpack": "^2.1.0-beta.20",
"webpack-dev-middleware": "^1.6.1", "webpack-dev-middleware": "^1.6.1",
"webpack-hot-middleware": "^2.12.2" "webpack-hot-middleware": "^2.12.2"
......
...@@ -51,7 +51,7 @@ app.use(favicon(resolve('./src/assets/logo.png'))) ...@@ -51,7 +51,7 @@ app.use(favicon(resolve('./src/assets/logo.png')))
app.get('*', (req, res) => { app.get('*', (req, res) => {
if (!renderer) { if (!renderer) {
return res.end('waiting for compilation...') return res.end('waiting for compilation... refresh in a moment.')
} }
var s = Date.now() var s = Date.now()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment