2017-04-30 11:58:25 +00:00
|
|
|
import ExtractTextPlugin from 'extract-text-webpack-plugin'
|
|
|
|
|
2017-05-05 15:53:21 +00:00
|
|
|
export function extractStyles () {
|
|
|
|
return !this.dev && this.options.build.extractCSS
|
2017-04-30 11:58:25 +00:00
|
|
|
}
|
|
|
|
|
2017-05-05 14:47:28 +00:00
|
|
|
export function styleLoader (ext, loader = []) {
|
2017-05-05 15:53:21 +00:00
|
|
|
if (extractStyles.call(this)) {
|
|
|
|
return ExtractTextPlugin.extract({
|
2017-05-09 11:24:55 +00:00
|
|
|
use: ['css-loader?minify&sourceMap'].concat(loader),
|
|
|
|
fallback: 'vue-style-loader?sourceMap'
|
2017-05-05 15:53:21 +00:00
|
|
|
})
|
2017-04-30 11:58:25 +00:00
|
|
|
}
|
2017-05-09 11:24:55 +00:00
|
|
|
return ['vue-style-loader?sourceMap', 'css-loader?sourceMap'].concat(loader)
|
2017-04-30 11:58:25 +00:00
|
|
|
}
|