From 5ba4275f73a13eebc7d055feeb58b82e05b65cc8 Mon Sep 17 00:00:00 2001 From: Alex Gleason Date: Mon, 9 May 2022 17:39:38 -0500 Subject: [PATCH 1/2] Stop doing Tabler import hack, use our forked version from git --- package.json | 2 +- webpack/shared.js | 3 --- yarn.lock | 7 +++---- 3 files changed, 4 insertions(+), 8 deletions(-) diff --git a/package.json b/package.json index 5d19be83b..4e3608b97 100644 --- a/package.json +++ b/package.json @@ -66,7 +66,7 @@ "@sentry/browser": "^6.12.0", "@sentry/react": "^6.12.0", "@sentry/tracing": "^6.12.0", - "@tabler/icons": "^1.53.0", + "@tabler/icons": "https://gitlab.com/soapbox-pub/tabler-icons.git", "@tailwindcss/forms": "^0.4.0", "@tailwindcss/typography": "^0.5.1", "@testing-library/react": "^12.1.4", diff --git a/webpack/shared.js b/webpack/shared.js index 9dee79de1..fb8308ee4 100644 --- a/webpack/shared.js +++ b/webpack/shared.js @@ -145,9 +145,6 @@ module.exports = { 'node_modules', ], alias: { - // Override tabler's package.json to allow importing .svg files directly - // https://stackoverflow.com/a/35990101/8811886 - '@tabler': resolve('node_modules', '@tabler'), 'icons': resolve('app', 'icons'), 'custom': resolve('custom'), }, diff --git a/yarn.lock b/yarn.lock index 9445a64a8..cb9d3fb3f 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1883,10 +1883,9 @@ remark "^13.0.0" unist-util-find-all-after "^3.0.2" -"@tabler/icons@^1.53.0": - version "1.53.0" - resolved "https://registry.yarnpkg.com/@tabler/icons/-/icons-1.53.0.tgz#51536e01b343cfaf26b701df306b2c0369769e3c" - integrity sha512-Skk1BqXEOEhiRsXJgZBYtjFa/+4dMSFA5UyzTUW20oyyUSd3iizhEWrYt0jT87iFu771gWoqVV2/OGobBcGjgQ== +"@tabler/icons@https://gitlab.com/soapbox-pub/tabler-icons.git": + version "1.68.0" + resolved "https://gitlab.com/soapbox-pub/tabler-icons.git#20e43498bdc0f38f75f176ef1a6526ca76c9172e" "@tailwindcss/forms@^0.4.0": version "0.4.0" From 660c098166ca2253a56a28f8432b1ae28a47f42f Mon Sep 17 00:00:00 2001 From: Alex Gleason Date: Mon, 9 May 2022 17:57:15 -0500 Subject: [PATCH 2/2] Allow custom module imports --- custom/modules/.gitkeep | 0 webpack/rules/assets.js | 5 ++++- webpack/shared.js | 1 + 3 files changed, 5 insertions(+), 1 deletion(-) create mode 100644 custom/modules/.gitkeep diff --git a/custom/modules/.gitkeep b/custom/modules/.gitkeep new file mode 100644 index 000000000..e69de29bb diff --git a/webpack/rules/assets.js b/webpack/rules/assets.js index 1b291ae0c..e0a14c250 100644 --- a/webpack/rules/assets.js +++ b/webpack/rules/assets.js @@ -66,7 +66,10 @@ module.exports = [{ }, { test: /\.svg$/, type: 'asset/resource', - include: resolve('node_modules', '@tabler'), + include: [ + resolve('node_modules', '@tabler'), + resolve('custom', 'modules', '@tabler'), + ], generator: { filename: 'packs/icons/[name]-[contenthash:8][ext]', }, diff --git a/webpack/shared.js b/webpack/shared.js index fb8308ee4..326981b8b 100644 --- a/webpack/shared.js +++ b/webpack/shared.js @@ -141,6 +141,7 @@ module.exports = { resolve: { extensions: settings.extensions, modules: [ + resolve('custom', 'modules'), resolve(settings.source_path), 'node_modules', ],