chore(frontend): bundle svg files into static
This commit is contained in:
parent
a5994e33c2
commit
f0bd9d57b5
4
Makefile
4
Makefile
@ -155,7 +155,7 @@ assets/icons: node_modules
|
|||||||
./utils/renamer.pl node_modules/@fortawesome/fontawesome-free/svgs/solid utils/rename-fa.json assets/icons/fradrive
|
./utils/renamer.pl node_modules/@fortawesome/fontawesome-free/svgs/solid utils/rename-fa.json assets/icons/fradrive
|
||||||
./utils/renamer.pl node_modules/@fortawesome/fontawesome-free/svgs/regular utils/rename-fa.json assets/icons/fradrive
|
./utils/renamer.pl node_modules/@fortawesome/fontawesome-free/svgs/regular utils/rename-fa.json assets/icons/fradrive
|
||||||
|
|
||||||
static: node_modules esbuild.config.mjs assets
|
static: node_modules assets esbuild.config.mjs
|
||||||
npm run build
|
npm run build
|
||||||
well-known: static;
|
well-known: static;
|
||||||
|
|
||||||
@ -319,7 +319,7 @@ start-minio: SINGLETON = true
|
|||||||
|
|
||||||
start-backend: BASE_PORTS = "DEV_PORT_HTTP=3000" "DEV_PORT_HTTPS=3443"
|
start-backend: BASE_PORTS = "DEV_PORT_HTTP=3000" "DEV_PORT_HTTPS=3443"
|
||||||
start-backend: SINGLETON = false
|
start-backend: SINGLETON = false
|
||||||
start-backend: static
|
start-backend: compile-frontend
|
||||||
|
|
||||||
start-hoogle: BASE_PORTS = "HOOGLE_PORT=8081"
|
start-hoogle: BASE_PORTS = "HOOGLE_PORT=8081"
|
||||||
start-hoogle: SINGLETON = true
|
start-hoogle: SINGLETON = true
|
||||||
|
|||||||
@ -2,8 +2,8 @@ import * as esbuild from 'esbuild';
|
|||||||
|
|
||||||
import babel from 'esbuild-plugin-babel';
|
import babel from 'esbuild-plugin-babel';
|
||||||
import { sassPlugin } from 'esbuild-sass-plugin';
|
import { sassPlugin } from 'esbuild-sass-plugin';
|
||||||
// import svgPlugin from 'esbuild-plugin-svg-bundle';
|
import svgPlugin from 'esbuild-plugin-svg-bundle';
|
||||||
import svgPlugin from 'esbuild-plugin-svg';
|
// import svgPlugin from 'esbuild-plugin-svg';
|
||||||
import { copy } from 'esbuild-plugin-copy';
|
import { copy } from 'esbuild-plugin-copy';
|
||||||
// import manifestPlugin from 'esbuild-plugin-manifest';
|
// import manifestPlugin from 'esbuild-plugin-manifest';
|
||||||
import manifestPlugin from 'esbuild-plugin-assets-manifest';
|
import manifestPlugin from 'esbuild-plugin-assets-manifest';
|
||||||
@ -25,15 +25,19 @@ await esbuild.build({
|
|||||||
},
|
},
|
||||||
outdir: staticDir,
|
outdir: staticDir,
|
||||||
plugins: [
|
plugins: [
|
||||||
|
/* inlineImportPlugin({
|
||||||
|
filter: /.svg/,
|
||||||
|
}), */
|
||||||
|
svgPlugin({
|
||||||
|
minify: true,
|
||||||
|
// hash: 'foo', // TODO: introduce caching of static files (maybe even in backend)
|
||||||
|
bundleFile: 'svg-bundle.svg',
|
||||||
|
bundleUrl: 'svg-bundle.svg',
|
||||||
|
}),
|
||||||
nodeModulesPolyfillPlugin({
|
nodeModulesPolyfillPlugin({
|
||||||
// modules: ['crypto','worker_threads']
|
// modules: ['crypto','worker_threads']
|
||||||
}),
|
}),
|
||||||
sassPlugin(),
|
sassPlugin(),
|
||||||
svgPlugin({
|
|
||||||
minify: true,
|
|
||||||
// bundleFile: `${wellKnownDir}/svg-bundle.svg`,
|
|
||||||
// bundleUrl: `${wellKnownDir}/svg-bundle.svg`,
|
|
||||||
}),
|
|
||||||
copy({
|
copy({
|
||||||
resolveFrom: 'cwd',
|
resolveFrom: 'cwd',
|
||||||
assets: {
|
assets: {
|
||||||
|
|||||||
@ -102,7 +102,7 @@ $icons: new,
|
|||||||
|
|
||||||
@each $name in $icons {
|
@each $name in $icons {
|
||||||
.ico-#{$name} {
|
.ico-#{$name} {
|
||||||
background-image: url('{}/../../assets/icons/fradrive/#{$name}.svg');
|
background-image: url('/mnt/fradrive/assets/icons/fradrive/#{$name}.svg');
|
||||||
background-size: contain;
|
background-size: contain;
|
||||||
background-repeat: no-repeat;
|
background-repeat: no-repeat;
|
||||||
background-position: center;
|
background-position: center;
|
||||||
|
|||||||
Reference in New Issue
Block a user