Created
October 10, 2017 16:03
-
-
Save dc198689/2d2d26e147f126f4895290f2b71be858 to your computer and use it in GitHub Desktop.
build/utils.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
exports.cssLoaders = function(options) { | |
... | |
... | |
function resolveResouce(fileName) { | |
// Absolute Path | |
return path.resolve(__dirname, '../src/assets/scss/' + fileName) | |
} | |
function generateSassResourceLoader() { | |
var loaders = [ | |
cssLoader, | |
'sass-loader', { | |
loader: 'sass-resources-loader', | |
options: { | |
resources: [ | |
resolveResouce('mixins/index.scss'), | |
resolveResouce('vars/index.scss') | |
] | |
} | |
} | |
]; | |
if (options.extract) { | |
return ExtractTextPlugin.extract({ | |
use: loaders, | |
fallback: 'vue-style-loader' | |
}) | |
} else { | |
return ['vue-style-loader'].concat(loaders) | |
} | |
} | |
... | |
... | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment