Skip to content

Commit 3571e6b

Browse files
committed
Merge pull request #77 from just-boris/patch-1
Use rule.append rather than manual node creation
2 parents 1b44ca4 + 8d49015 commit 3571e6b

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

src/index.js

+6-5
Original file line numberDiff line numberDiff line change
@@ -149,15 +149,16 @@ const processor = postcss.plugin('postcss-modules-scope', function(options) {
149149
// If we found any :locals, insert an :export rule
150150
let exportedNames = Object.keys(exports);
151151
if (exportedNames.length > 0) {
152-
css.append(postcss.rule({
153-
selector: `:export`,
154-
nodes: exportedNames.map(exportedName => postcss.decl({
152+
let exportRule = postcss.rule({selector: `:export`});
153+
exportedNames.forEach(exportedName =>
154+
exportRule.append({
155155
prop: exportedName,
156156
value: exports[exportedName].join(' '),
157157
raws: { before: '\n ' },
158158
_autoprefixerDisabled: true
159-
}))
160-
}));
159+
})
160+
);
161+
css.append(exportRule);
161162
}
162163
};
163164
});

0 commit comments

Comments
 (0)