Skip to content
Permalink
Browse files
Upgrade PostCSS to 6.0.* (vuejs#176)
* Update PostCSS to ^6.0.*

* De-indent package.json

* Undo package.json formatting
  • Loading branch information
jeffberry authored and znck committed Mar 18, 2018
1 parent f918a7f commit 31a8c57df574fbb5e94d92a1d0b683d339d035a6
Showing 4 changed files with 155 additions and 120 deletions.
@@ -43,10 +43,10 @@
"magic-string": "^0.22.4",
"merge-options": "^1.0.0",
"parse5": "^3.0.3",
"postcss": "^5.2.11",
"postcss": "^6.0.19",
"postcss-load-config": "^1.2.0",
"postcss-modules": "^0.6.4",
"postcss-selector-parser": "^2.2.3",
"postcss-modules": "^1.1.0",
"postcss-selector-parser": "^3.1.1",
"posthtml": "^0.10.1",
"posthtml-attrs-parser": "^0.1.1",
"rollup-pluginutils": "^2.0.1",
@@ -83,7 +83,7 @@
"coffeescript-compiler": "^0.1.1",
"less": "^2.7.2",
"node-sass": "^4.5.0",
"pug": "^2.0.0-beta11",
"pug": "^2.0.1",
"stylus": "^0.54.5"
},
"peerDependencies": {
@@ -63,7 +63,9 @@ const addScopeID = postcss.plugin('add-scope-id', ({ scopeID }) => {

return root => {
root.walkRules(rule => {
rule.selector = selectorTransformer.process(rule.selector).result
selectorTransformer.processSync(rule, {
updateSelector: true
})
})
}
})
@@ -100,7 +102,7 @@ export default async function (promise, options) {
const hasModule = style.module === true
const hasScope = style.scoped === true
const postcssConfig = await postcssLoadConfig(options.postcss)
const plugins = postcssConfig.plugins || []
const plugins = [...postcssConfig.plugins] || []
let processPromise = Promise.resolve()

if (hasScope) {
@@ -149,7 +149,7 @@ async function processStyle (styles, id, content, options) {

const map = (new MagicString(code)).generateMap({ hires: true })

const output = {
let output = {
id,
code: code,
map: map,
@@ -158,7 +158,11 @@ async function processStyle (styles, id, content, options) {
scoped: 'scoped' in style.attrs
}

outputs.push(options.autoStyles || output.scoped || output.module ? await compile(output, options) : output)
if (options.autoStyles || output.scoped || output.module) {
output = await compile(output, options)
}

outputs.push(output)
}

return outputs

0 comments on commit 31a8c57

Please sign in to comment.