Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

@bem-react/pack: support relative imports

Aperta
#598 0 commenti 0 reazioni 1 assegnatario Vedi su GitHub

@yarastqt ci sta già lavorando.

Dal 9/1/2021.

  • #599 di @Firnis — chiusa senza merge

Valutazione

Questa issue non è ancora stata valutata.

Descrizione

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.

Lingua principale
TypeScript
Stelle
450
Fork
69
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di bem/bem-react

Tutte le issue di bem/bem-react

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.