Skip to content

Commit

Permalink
fix(vue): options for vue to use css-modules
Browse files Browse the repository at this point in the history
  • Loading branch information
egoist committed Feb 27, 2016
1 parent 2345d58 commit 9bc6691
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions lib/webpack.config.vue.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,14 @@ module.exports = function (type, options) {
loaders: {},
postcss: config.postcss
}

const postcssLoader = options.cssmodules
? 'css-loader?modules&importLoaders=1!postcss-loader'
: 'css-loader!postcss-loader'
if (type === 'watch') {
// configs only for watch mode
} else if (type === 'build') {
// configs only for build mode
config.vue.loaders.css = ExtractTextPlugin.extract('style-loader', 'css-loader!postcss-loader')
config.vue.loaders.css = ExtractTextPlugin.extract('style-loader', postcssLoader)
}
return config
}

0 comments on commit 9bc6691

Please sign in to comment.