Skip to content

Commit

Permalink
move default css loaders into base config
Browse files Browse the repository at this point in the history
  • Loading branch information
yyx990803 committed Mar 16, 2016
1 parent 7023fbb commit 857ef3c
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 14 deletions.
7 changes: 7 additions & 0 deletions template/build/webpack.base.conf.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
var path = require('path')
var cssLoaders = require('./css-loaders')
var projectRoot = path.resolve(__dirname, '../')

module.exports = {
Expand Down Expand Up @@ -64,6 +65,12 @@ module.exports = {
}
]
},
vue: {
loaders: cssLoaders({
sourceMap: false,
extract: false
})
},
eslint: {
formatter: require('eslint-friendly-formatter')
}
Expand Down
7 changes: 0 additions & 7 deletions template/build/webpack.dev.conf.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
var webpack = require('webpack')
var merge = require('webpack-merge')
var baseConfig = require('./webpack.base.conf')
var cssLoaders = require('./css-loaders')
var HtmlWebpackPlugin = require('html-webpack-plugin')

// add hot-reload related code to entry chunks
Expand All @@ -17,12 +16,6 @@ module.exports = merge(baseConfig, {
// when serving the html from in-memory
publicPath: '/'
},
vue: {
loaders: cssLoaders({
sourceMap: false,
extract: false
})
},
plugins: [
// https://github.com/glenjamin/webpack-hot-middleware#installation--usage
new webpack.optimize.OccurenceOrderPlugin(),
Expand Down
7 changes: 0 additions & 7 deletions template/test/unit/karma.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,6 @@ var path = require('path')
var merge = require('webpack-merge')
var baseConfig = require('../../build/webpack.base.conf')
var projectRoot = path.resolve(__dirname, '../../')
var cssLoaders = require('../../build/css-loaders')({
sourceMap: false,
extract: false
})

var webpackConfig = merge(baseConfig, {
// use inline sourcemap for karma-sourcemap-loader
Expand All @@ -22,9 +18,6 @@ var webpackConfig = merge(baseConfig, {
}
})

// merge css loaders with vue loaders
webpackConfig.vue.loaders = merge(webpackConfig.vue.loaders, cssLoaders)

// no need for app entry during tests
delete webpackConfig.entry

Expand Down

0 comments on commit 857ef3c

Please sign in to comment.