diff --git a/lib/getCriticalRules.js b/lib/getCriticalRules.js index e28f21d..961e314 100644 --- a/lib/getCriticalRules.js +++ b/lib/getCriticalRules.js @@ -71,11 +71,12 @@ function correctSourceOrder(root) { * @return {Object} A new root node with an atrule at its base. */ function establishContainer(node) { - return node.parent.type === 'atrule' && node.parent.name !== 'critical' ? updateCritical(_postcss2.default.atRule({ + return node.parent.type === 'atrule' && node.parent.name !== 'critical' ? _postcss2.default.atRule({ name: node.parent.name, type: node.parent.type, - params: node.parent.params - }), node) : node.clone(); + params: node.parent.params, + nodes: [node] + }) : node.clone(); } /** diff --git a/package.json b/package.json index 90c13ba..6190fbe 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "postcss-critical-css", - "version": "2.1.3", + "version": "2.1.4", "description": "Generate critical CSS using PostCSS", "main": "index.js", "repository": { @@ -19,7 +19,6 @@ "author": "Zach Green", "license": "MIT", "devDependencies": { - "babel": "^6.5.2", "babel-cli": "^6.11.4", "babel-eslint": "^7.2.3", "babel-plugin-transform-flow-strip-types": "^6.8.0", diff --git a/src/getCriticalRules.js b/src/getCriticalRules.js index f562250..3fa4fb0 100644 --- a/src/getCriticalRules.js +++ b/src/getCriticalRules.js @@ -63,14 +63,12 @@ function correctSourceOrder (root: Object): Object { */ function establishContainer (node: Object): Object { return node.parent.type === 'atrule' && node.parent.name !== 'critical' - ? updateCritical( - postcss.atRule({ - name: node.parent.name, - type: node.parent.type, - params: node.parent.params - }), - node - ) + ? postcss.atRule({ + name: node.parent.name, + type: node.parent.type, + params: node.parent.params, + nodes: [node] + }) : node.clone() }