father
father copied to clipboard
js中解构css Modules :export报错:Error: 'x' is not exported by xxx.less, imported by yyy.tsx
theme.less:
RadioButton.tsx:
配置文件:
import themes from './src/components/style/index';
export default {
esm: 'rollup',
cssModules: true,
extractCSS: true,
runtimeHelpers: true,
lessInRollupMode: {
modifyVars: themes,
javascriptEnabled: true,
},
};
仅发生在解构时,直接引用可以
import globalVars from 'xxxx.less';
const fontSize = globalVars.fontSize;
添加namedExports: true后正常,但是father没有提供配置项供外部配置,能否加个自定义rollup-plugin-postcss配置的配置项?
@PeachScript
father 4 已发布,可尝试升级到最新版:https://github.com/umijs/father/blob/master/docs/guide/migrate.md
旧版本不再维护,感谢支持