Skip to content

Commit 7e6b5e6

Browse files
dfahlanderDavid Fahlander
andauthored
Fix build issue in dexie-export-import (rollup config) (#2117)
* Fix build issue in dexie-export-import (rollup config) * Remove console output --------- Co-authored-by: David Fahlander <[email protected]>
1 parent 216ec56 commit 7e6b5e6

File tree

3 files changed

+16
-4
lines changed

3 files changed

+16
-4
lines changed

addons/dexie-export-import/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,12 @@
2424
],
2525
"src": [
2626
"tsc -p src",
27-
"rollup -c tools/build-configs/rollup.config.js"
27+
"rollup -c tools/build-configs/rollup.config.mjs"
2828
],
2929
"test": [
3030
"tsc -p test [--watch 'Watching for file changes.']",
31-
"rollup -c tools/build-configs/rollup.config.js",
32-
"rollup -c tools/build-configs/rollup.tests.config.js"
31+
"rollup -c tools/build-configs/rollup.config.mjs",
32+
"rollup -c tools/build-configs/rollup.tests.config.mjs"
3333
]
3434
},
3535
"author": "[email protected]",

addons/dexie-export-import/tools/build-configs/rollup.config.js renamed to addons/dexie-export-import/tools/build-configs/rollup.config.mjs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,15 @@ import path from 'path';
44
import commonjs from 'rollup-plugin-commonjs';
55
import nodeResolve from 'rollup-plugin-node-resolve';
66
import alias from '@rollup/plugin-alias';
7+
import { fileURLToPath } from 'url';
78

8-
const version = require(path.resolve(__dirname, '../../package.json')).version;
9+
// Define __dirname
10+
const __filename = fileURLToPath(import.meta.url);
11+
const __dirname = path.dirname(__filename);
12+
13+
//const version = require(path.resolve(__dirname, '../../package.json')).version;
14+
const packageJsonPath = new URL('../../package.json', import.meta.url).pathname;
15+
const { version } = JSON.parse(readFileSync(packageJsonPath, 'utf-8'));
916

1017
const ERRORS_TO_IGNORE = [
1118
"THIS_IS_UNDEFINED",

addons/dexie-export-import/tools/build-configs/rollup.tests.config.js renamed to addons/dexie-export-import/tools/build-configs/rollup.tests.config.mjs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,11 @@ import commonjs from 'rollup-plugin-commonjs';
33
import nodeResolve from 'rollup-plugin-node-resolve';
44
import path from 'path';
55
import alias from '@rollup/plugin-alias';
6+
import { fileURLToPath } from 'url';
7+
8+
// Define __dirname
9+
const __filename = fileURLToPath(import.meta.url);
10+
const __dirname = path.dirname(__filename);
611

712
const ERRORS_TO_IGNORE = [
813
"THIS_IS_UNDEFINED"

0 commit comments

Comments
 (0)