From 37e0923bb183c16fa30d0a5135a1b4107054b210 Mon Sep 17 00:00:00 2001 From: Fedor Katurov Date: Fri, 7 Jan 2022 18:52:50 +0700 Subject: [PATCH] fixed svg url loading --- craco.config.js | 11 ++--------- src/layouts/BorisLayout/index.tsx | 2 +- 2 files changed, 3 insertions(+), 10 deletions(-) diff --git a/craco.config.js b/craco.config.js index 61d2348b..7be4cbdf 100644 --- a/craco.config.js +++ b/craco.config.js @@ -10,15 +10,8 @@ module.exports = { }, rules: [ { - test: /\.(svg)$/, - use: [ - { - loader: 'file-loader', - options: { - name: 'images/[hash]-[name].[ext]', - }, - }, - ], + test: /\.svg/, + type: 'asset/resource', }, ], }, diff --git a/src/layouts/BorisLayout/index.tsx b/src/layouts/BorisLayout/index.tsx index d22c4d24..3e565a12 100644 --- a/src/layouts/BorisLayout/index.tsx +++ b/src/layouts/BorisLayout/index.tsx @@ -13,7 +13,7 @@ import { Tabs } from '~/components/dialogs/Tabs'; import { Superpower } from '~/components/boris/Superpower'; import { BorisUIDemo } from '~/components/boris/BorisUIDemo'; -const boris = require('~/sprites/boris_robot.svg'); +import boris from '~/sprites/boris_robot.svg'; type IProps = { title: string;