Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Auto-import styles with vue-cli 3
const path = require('path')
module.exports = {
chainWebpack: config => {
const types = ['vue-modules', 'vue', 'normal-modules', 'normal']
types.forEach(type => addStyleResource(config.module.rule('stylus').oneOf(type)))
function addStyleResource (rule) {
patterns: [
path.resolve(__dirname, './src/styles/imports.styl'),

This comment has been minimized.

Copy link
Owner Author

@Akryum Akryum commented Jul 18, 2018


yarn add style-resources-loader -D
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment