@bem-react/pack: support relative imports
评估
这个 Issue 还没有评估数据。
描述
Example project:
src/components/Test/Test.scss
@import '../../../node_modules/@my-company/design/constants.scss';
.Test {
background-color: $test-color;
width: 100px;
height: 100px;
background-image: url('../../../node_modules/@my-company/icons/icon.svg');
}
src/components/Test/Test.tsx
import { createElement } from 'react';
import './Test.scss';
export const Test = () => {
return createElement('div');
};
src/components/Test/index.ts
export * from './Test';
got error: Error: Failed to find '../../../node_modules/@my-company/design/constants.scss'
in [
/Users/firnis/projects/pack-example
]
This problem can be fixed by providing filepath to postcss processor here
With fixed CssPlugin build is working.
But now we have problem when we try to use our component.
dist/esm/components/Test/Test.css
.Test {
background-color: #000;
width: 100px;
height: 100px;
background-image: url('../../../node_modules/@my-company/icons/icon.svg');
}
There is no such path ./dist/node_modules/
To fix this we should change path for esm directory in TypeScript plugin. We can add optional config param esmOutput.
- 主要语言
- TypeScript
- 星标
- 450
- 派生
- 69
- PR 合并指标
- 30 天内没有已合并 PR
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
bem/bem-react 的其他 Issue
-
@bem-react/classname: Unclear typing for element-bound class name formatters可能已有人在做 @rrabmig 于 112 天前认领。 未关闭
难度 3/5 1-2 天 新手友好度 68/100
-
难度 5/5 一周以上 新手友好度 25/100
-
@bem-react/classname: Can't add modifier with value === 0可能已有人在做 @frontstall 于 933 天前认领。 未关闭
难度 2/5 1-3 小时 新手友好度 55/100
-
难度 2/5 1-3 小时 新手友好度 52/100
-
@bem-react/pack: Impl plugin for prepare package.json可能重新可做 @yarastqt 于 2119 天前认领,目前没有进行中的 PR。 未关闭improvement scope: pack
相似的 Issue
-
area/frontend area/v2 kind/bug priority/needs-triage
难度 2/5 1-3 小时 新手友好度 70/100
kubeflow/notebooks#1498 · 1 条评论 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 75/100
维护者通常 1 天内回复
-
P1
难度 2/5 1-3 小时 新手友好度 66/100
SuruchBoss/Cwork#90 ·
-
bug cli service
难度 2/5 1-3 小时 新手友好度 82/100
维护者通常 1 天内回复
-
难度 1/5 1 小时以内 新手友好度 85/100
521xueweihan/HelloGitHub#3922 ·