okam-build
Version:
The build tool for Okam develop framework
19 lines (15 loc) • 429 B
JavaScript
/**
* @file postcss wxss to swan css plugin
* @author xiaohong8023@outlook.com
*/
;
const postcss = require('postcss');
module.exports = postcss.plugin('postcss-plugin-wx2swan', function (opts = {}) {
return function (css) {
css.walkAtRules(rule => {
if (rule.name === 'import') {
rule.params = rule.params.replace(/\.wxss/, '.css');
}
});
};
});