Skip to content

Commit

Permalink
Merge pull request #27 from drolsen/dev
Browse files Browse the repository at this point in the history
Dev: 1.5.2 Release
  • Loading branch information
drolsen authored Dec 13, 2021
2 parents 3e7021d + bb3b8b9 commit 4718a2b
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 18 deletions.
18 changes: 5 additions & 13 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ class POSTCSSInOut {
this.options = options;
}

process(children, callback) {
processPostBuild(children, callback) {
const collection = Object.keys(children).map((j) => {
let child = children[j];
if (typeof child === 'object') {
Expand Down Expand Up @@ -68,21 +68,13 @@ class POSTCSSInOut {
compilation.hooks.processAssets.tap(
{
name: 'POSTCSSInOut',
stage: compilation.PROCESS_ASSETS_STAGE_ADDITIONS, // see below for more stages
additionalAssets: true
stage: compilation.PROCESS_ASSETS_STAGE_ADDITIONS // see below for more stages
},
(assets) => {
Object.keys(assets).map((i) => {
if (i.indexOf('.css') !== -1) {
this.process(assets[i]._source._children, (results) => {
assets[i]._source._children = [];

compilation.updateAsset(
i,
new sources.RawSource(
results
)
);
this.processPostBuild(assets[i]._source._children, (results) => {
compilation.updateAsset(i, new sources.RawSource(results));
});
}
});
Expand All @@ -95,4 +87,4 @@ class POSTCSSInOut {
}
}

module.exports = POSTCSSInOut;
module.exports = POSTCSSInOut;
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"postcss global variables",
"postcss global features"
],
"version": "1.5.1",
"version": "1.5.2",
"description": "Plugin to add pre & post build hooks for global POSTCSS features",
"repository": "drolsen/postcss-in-out",
"bugs": {
Expand All @@ -30,8 +30,8 @@
"mini-css-extract-plugin": "^1.3.2",
"postcss-import": "^13.0.0",
"postcss-nested": "^5.0.3",
"webpack": "^5.10.0",
"webpack-cli": "^4.2.0"
"webpack": "^5.64.0",
"webpack-cli": "^4.9.1"
},
"dependencies": {
"postcss": "^8.2.1",
Expand Down
4 changes: 2 additions & 2 deletions test/test.plugins.js
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,8 @@ const media = (options = {}) => {
if (key === variable) {
rule.params = queries[key];

// gather meida queries inners
rule.walkRules(innerRules => {
// gather media queries inners
root.walkRules(innerRules => {
let stringSelector = ` ${innerRules.selector} {\n`;
innerRules.walkDecls(innerDecl => {
stringSelector += ` ${innerDecl.prop}: ${innerDecl.value};\n`;
Expand Down

0 comments on commit 4718a2b

Please sign in to comment.