Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

father-build build的时候我在tsx里引入import style from "./index.less"; 报模块找不到,请问这里是怎么配置,.fatherrc.ts #874

Closed
dongcer opened this issue Sep 11, 2021 · 1 comment
Labels
question Further information is requested

Comments

@dongcer
Copy link

dongcer commented Sep 11, 2021

Question

$ father-build Clean dist directory Build cjs with babel Clean lib directory src\commonFC\FWTable\index.tsx(3,19): error TS2307: Cannot find module './index.less' or its corresponding type declarations. src\Foo\index.tsx(2,19): error TS2307: Cannot find module './index.less' or its corresponding type declarations.

Sample Code

export default {
// esm: 'rollup',
// cjs: 'rollup',
cssModules: true,
esm: 'babel',
cjs: 'babel',
// cssModules: true,
// runtimeHelpers: true,
lessInBabelMode: true,
// extractCSS: true,

extraBabelPlugins: [
[
'babel-plugin-import',
{
libraryName: 'antd',
libraryDirectory: 'es',
style: true,
},
],
],
extraPostCSSPlugins: [],
};

@dongcer dongcer added the question Further information is requested label Sep 11, 2021
@PeachScript
Copy link
Member

参考:umijs/father#227 (comment) ,后续 father-build 相关问题请到 father 仓库提交 issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants