Skip to content

Commit 2e91dca

Browse files
committed
Updated postcss configuration
This follows the migration guide at https://evilmartians.com/chronicles/postcss-8-plugin-migration
1 parent 3514e3d commit 2e91dca

File tree

2 files changed

+16
-11
lines changed

2 files changed

+16
-11
lines changed

examples/web3/package.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,5 +37,8 @@
3737
"typescript": "~4.3.2",
3838
"url-loader": "^4.1.1",
3939
"webpack": "^5.65.0"
40+
},
41+
"peerDependencies": {
42+
"postcss": "^8.0.0"
4043
}
4144
}

examples/web3/webpack.config.js

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -22,20 +22,22 @@ module.exports = {
2222
options: {
2323
postcssOptions: {
2424
plugins: [
25-
postcss.plugin('delete-tilde', function () {
26-
return function (css) {
27-
css.walkAtRules('import', function (rule) {
28-
rule.params = rule.params.replace('~', '');
29-
});
30-
};
31-
}),
32-
postcss.plugin('prepend', function () {
33-
return function (css) {
25+
{
26+
postcssPlugin: 'delete-tilde',
27+
AtRule: {
28+
import: (atRule) => {
29+
atRule.params = atRule.params.replace('~', '');
30+
},
31+
},
32+
},
33+
{
34+
postcssPlugin: 'prepend',
35+
Once(css) {
3436
css.prepend(
3537
"@import '@jupyter-widgets/controls/css/labvariables.css';"
3638
);
37-
};
38-
}),
39+
},
40+
},
3941
require('postcss-import')(),
4042
require('postcss-cssnext')(),
4143
],

0 commit comments

Comments
 (0)