Created
October 26, 2018 13:23
-
-
Save sandiprb/46481cad62c870992477d9f112578de1 to your computer and use it in GitHub Desktop.
postcss rc for vue 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
const path = require('path') | |
module.exports = { | |
plugins: { | |
"postcss-import": { | |
resolve(id, basedir) { | |
// resolve alias @css, @import '@css/style.css' | |
// because @css/ has 5 chars | |
if (/^@css/.test(id)) { | |
return path.resolve('./src/assets/css', id.slice(5)) | |
} | |
// resolve node_modules, @import '~normalize.css/normalize.css' | |
// similar to how css-loader's handling of node_modules | |
if (/^~/.test(id)) { | |
return path.resolve('./node_modules', id) | |
} | |
// resolve relative path, @import './components/style.css' | |
return path.resolve(basedir, id) | |
} | |
}, | |
"postcss-mixins": {}, | |
"postcss-simple-vars": {}, | |
"postcss-color-function": {}, | |
"postcss-nested": {}, | |
"postcss-extend": {}, | |
"postcss-discard-comments": {}, | |
"postcss-discard-empty": {}, | |
"autoprefixer": { | |
"browsers": "> 1%, IE 6, Explorer >= 10, Safari >= 7" | |
}, | |
"cssnano": {} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment