Add svg support

This commit is contained in:
GHOSCHT 2021-07-09 12:31:16 +02:00
parent 00d253c487
commit d35506112b
5 changed files with 23 additions and 3 deletions

4
Dashboard/assets/assets.d.ts vendored Normal file
View file

@ -0,0 +1,4 @@
declare module "*.svg" {
const content: any;
export default content;
}

View file

@ -84,6 +84,7 @@
"eslint-plugin-jsx-a11y": "^6.4.1",
"eslint-plugin-react": "^7.24.0",
"eslint-plugin-react-hooks": "^4.2.0",
"file-loader": "^6.2.0",
"fork-ts-checker-webpack-plugin": "^6.2.12",
"html-webpack-plugin": "^4.3.0",
"style-loader": "^1.2.1",

View file

@ -22,6 +22,6 @@
"resolveJsonModule": true,
"allowJs": true
},
"include": ["src"],
"include": ["src", "assets/assets.d.ts"],
"exclude": ["src/electron.js"]
}

View file

@ -45,8 +45,15 @@ module.exports = (env, argv) => {
use: ["style-loader", "css-loader"],
},
{
test: /\.(jpg|jpeg|png|gif|mp3|svg)$/,
use: ["file-loader"],
test: /\.(png|jp(e*)g|svg|gif)$/,
use: [
{
loader: "file-loader",
options: {
name: "assets/[hash]-[name].[ext]",
},
},
],
},
],
},

View file

@ -3758,6 +3758,14 @@ file-entry-cache@^6.0.1:
dependencies:
flat-cache "^3.0.4"
file-loader@^6.2.0:
version "6.2.0"
resolved "https://registry.yarnpkg.com/file-loader/-/file-loader-6.2.0.tgz#baef7cf8e1840df325e4390b4484879480eebe4d"
integrity sha512-qo3glqyTa61Ytg4u73GultjHGjdRyig3tG6lPtyX/jOEJvHif9uB0/OCI2Kif6ctF3caQTW2G5gym21oAsI4pw==
dependencies:
loader-utils "^2.0.0"
schema-utils "^3.0.0"
file-uri-to-path@1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/file-uri-to-path/-/file-uri-to-path-1.0.0.tgz#553a7b8446ff6f684359c445f1e37a05dacc33dd"