fix: Fix code that might be wrong.
module.exports = function (context, options) {
return {
configurePostCss(postcssOptions) {
+ try {
postcssOptions.plugins.push(
require('postcss-px-to-viewport-8-plugin')({
exclude: [/node_modules/],
@@ -14,7 +15,10 @@ module.exports = function (context, options) {
],
}),
)
- return postcssOptions
+ return postcssOptions;
+ } catch (error) {
+ console.log(`${error}, perhaps you have not installed the postcss-px-to-viewport-8-plugin, please run "yarn add postcss-px-to-viewport-8-plugin"`);
+ }
},
}
}
\ No newline at end of file
