|
1 | 1 | import { execSync } from 'node:child_process' |
2 | 2 | import { readFileSync } from 'node:fs' |
| 3 | +import { dirname, join } from 'node:path' |
3 | 4 | import process from 'node:process' |
4 | 5 | import { fileURLToPath } from 'node:url' |
5 | 6 | import virtual from '@rollup/plugin-virtual' |
6 | 7 | import { consola } from 'consola' |
7 | 8 | import topLevelAwait from 'vite-plugin-top-level-await' |
8 | 9 | import wasm from 'vite-plugin-wasm' |
9 | 10 |
|
10 | | -const packageJsonPath = fileURLToPath(new URL('./package.json', import.meta.url)) |
| 11 | +// Use absolute paths to avoid deployment issues |
| 12 | +const __dirname = dirname(fileURLToPath(import.meta.url)) |
| 13 | +const packageJsonPath = join(__dirname, 'package.json') |
11 | 14 | const packageJsonContent = readFileSync(packageJsonPath, 'utf8') |
12 | 15 | const { description, name, version } = JSON.parse(packageJsonContent) |
13 | 16 |
|
@@ -150,20 +153,13 @@ export default defineNuxtConfig({ |
150 | 153 | ], |
151 | 154 | }, |
152 | 155 |
|
153 | | - // // https://github.com/csstree/csstree/issues/314 |
154 | | - // externals: { |
155 | | - // // Add data directory to externals to ensure JSON files are included |
156 | | - // inline: ['./data'], |
157 | | - // }, |
158 | | - // // https://github.com/csstree/csstree/issues/314 |
159 | | - // publicAssets: [ |
160 | | - // // Make data files accessible as public assets |
161 | | - // { |
162 | | - // dir: 'data', |
163 | | - // baseURL: '/data', |
164 | | - // maxAge: 60 * 60 * 24 * 7, // 1 week |
165 | | - // }, |
166 | | - // ], |
| 156 | + // Include node_modules and package.json in the bundle |
| 157 | + externals: { |
| 158 | + inline: ['./node_modules', './package.json'], |
| 159 | + }, |
| 160 | + |
| 161 | + // Properly resolve local files during build |
| 162 | + moduleSideEffects: ['nimiq-validator-trustscore'], |
167 | 163 | }, |
168 | 164 |
|
169 | 165 | compatibilityDate: '2025-03-21', |
|
0 commit comments