Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

@bem-react/pack: support relative imports

オープン
#598 コメント 0 件 リアクション 0 件 担当者 1 名 GitHub で見る

@yarastqt がすでに取り組んでいます。

2021年1月9日 から。

  • #599 @Firnis による — マージされずにクローズ

評価

この issue はまだ評価されていません。

説明

bug scope: pack

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 はありません

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

bem/bem-react のほかの issue

bem/bem-react の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。