From 2448c0531b2a31bcb5bd22d333b59a63d33d22e2 Mon Sep 17 00:00:00 2001 From: Dmitry Popov Date: Tue, 4 Feb 2025 20:20:34 +0100 Subject: [PATCH] fix(Core): include external libraries in build --- .github/workflows/build.yml | 1 + assets/app.tsx | 3 -- assets/package.json | 8 ++-- assets/vite.config.js | 25 ++---------- .../components/layouts/root.html.heex | 39 ------------------- 5 files changed, 9 insertions(+), 67 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index af827743..bf825add 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -140,6 +140,7 @@ jobs: platform: - linux/amd64 - linux/arm64 + - linux/arm64/v8 steps: - name: Prepare run: | diff --git a/assets/app.tsx b/assets/app.tsx index b3d02283..bc170b91 100644 --- a/assets/app.tsx +++ b/assets/app.tsx @@ -1,6 +1,3 @@ -// import '@fontsource-variable/inter' -// import '@fontsource-variable/jetbrains-mono' -// import './lib/tailwind/index.css'; import './css/app.css'; import './lib/phoenix'; diff --git a/assets/package.json b/assets/package.json index 918d757d..d4bfbbcb 100644 --- a/assets/package.json +++ b/assets/package.json @@ -25,6 +25,8 @@ "primeflex": "^3.3.1", "primeicons": "^7.0.0", "primereact": "^10.6.5", + "react": "^18.3.1", + "react-dom": "^18.3.1", "react-error-boundary": "^4.0.13", "react-event-hook": "^3.1.2", "react-flow-renderer": "^10.3.17", @@ -42,12 +44,12 @@ "@tailwindcss/typography": "^0.5.13", "@types/lodash.debounce": "^4.0.9", "@types/lodash.isequal": "^4.5.8", - "@types/react": "18.2.0", - "@types/react-dom": "18.2.1", + "@types/react": "^18.3.12", + "@types/react-dom": "^18.3.1", "@types/react-grid-layout": "^1.3.4", "@typescript-eslint/eslint-plugin": "^6.21.0", "@typescript-eslint/parser": "^6.21.0", - "@vitejs/plugin-react": "^4.3.0", + "@vitejs/plugin-react": "^4.3.3", "@vitejs/plugin-react-refresh": "^1.3.6", "autoprefixer": "^10.4.19", "child_process": "^1.0.2", diff --git a/assets/vite.config.js b/assets/vite.config.js index 1f19d0e7..a7155efc 100644 --- a/assets/vite.config.js +++ b/assets/vite.config.js @@ -1,24 +1,10 @@ -import cdn from 'vite-plugin-cdn-import'; import path from 'path'; +import react from '@vitejs/plugin-react'; + export default { publicDir: './static', - plugins: [ - cdn({ - modules: [ - { - name: 'react', - var: 'React', - path: `umd/react.production.min.js`, - }, - { - name: 'react-dom', - var: 'ReactDOM', - path: `umd/react-dom.production.min.js`, - }, - ], - }), - ], + plugins: [react()], build: { target: 'es2018', format: 'esm', @@ -27,13 +13,8 @@ export default { emptyOutDir: true, assetsInlineLimit: 0, rollupOptions: { - external: ['react', 'react-dom'], input: ['app.tsx'], output: { - globals: { - react: 'React', - 'react-dom': 'ReactDOM', - }, entryFileNames: 'assets/[name].js', chunkFileNames: 'assets/[name]-[hash].js', assetFileNames: 'assets/[name][extname]', diff --git a/lib/wanderer_app_web/components/layouts/root.html.heex b/lib/wanderer_app_web/components/layouts/root.html.heex index 89221e90..93915990 100644 --- a/lib/wanderer_app_web/components/layouts/root.html.heex +++ b/lib/wanderer_app_web/components/layouts/root.html.heex @@ -30,48 +30,9 @@ type="font/woff2" crossorigin="anonymous" /> - - - - - - - - - -