Esbuild: Import scss / svg

Created on 7 Jul 2020  路  2Comments  路  Source: evanw/esbuild

FYI

import './index.css';
       ~~~~~~~~~~~~~
src/components/UploadsExtContainer/UploadsExtContainer.tsx:10:16: error: File extension not supported: src/components/UploadsExtContainer/UploadsExtContainer.module.scss
import stl from './UploadsExtContainer.module.scss';
                ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/components/UploadsExtContainer/UploadsExtContainer.tsx:6:22: error: File extension not supported: src/ui/icons/thinArrow.svg
import arrowIcon from '@/ui/icons/thinArrow.svg';
                      ~~~~~~~~~~~~~~~~~~~~~~~~~~

馃殌

Most helpful comment

CSS support is tracked by #20. I believe it should be possible to use SCSS once that and #111 are implemented.

SVG may already work depending on what you need the bundler to do for you. For example, --loader:.svg=text. will cause import arrowIcon from '@/ui/icons/thinArrow.svg' to populate arrowIcon with the SVG file as a string.

All 2 comments

CSS support is tracked by #20. I believe it should be possible to use SCSS once that and #111 are implemented.

SVG may already work depending on what you need the bundler to do for you. For example, --loader:.svg=text. will cause import arrowIcon from '@/ui/icons/thinArrow.svg' to populate arrowIcon with the SVG file as a string.

Documentation for the plugin API has now been released: https://esbuild.github.io/plugins/. Closing this because you should be able to build these integrations yourself.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

sarsamurmu picture sarsamurmu  路  3Comments

ojanvafai picture ojanvafai  路  3Comments

wcastand picture wcastand  路  4Comments

egoist picture egoist  路  3Comments

evanplaice picture evanplaice  路  3Comments