Skip to content

Commit

Permalink
Fix build issue in dexie-export-import (rollup config) (#2117)
Browse files Browse the repository at this point in the history
* Fix build issue in dexie-export-import (rollup config)

* Remove console output

---------

Co-authored-by: David Fahlander <[email protected]>
  • Loading branch information
dfahlander and David Fahlander authored Jan 11, 2025
1 parent 216ec56 commit 7e6b5e6
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 4 deletions.
6 changes: 3 additions & 3 deletions addons/dexie-export-import/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,12 @@
],
"src": [
"tsc -p src",
"rollup -c tools/build-configs/rollup.config.js"
"rollup -c tools/build-configs/rollup.config.mjs"
],
"test": [
"tsc -p test [--watch 'Watching for file changes.']",
"rollup -c tools/build-configs/rollup.config.js",
"rollup -c tools/build-configs/rollup.tests.config.js"
"rollup -c tools/build-configs/rollup.config.mjs",
"rollup -c tools/build-configs/rollup.tests.config.mjs"
]
},
"author": "[email protected]",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,15 @@ import path from 'path';
import commonjs from 'rollup-plugin-commonjs';
import nodeResolve from 'rollup-plugin-node-resolve';
import alias from '@rollup/plugin-alias';
import { fileURLToPath } from 'url';

const version = require(path.resolve(__dirname, '../../package.json')).version;
// Define __dirname
const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);

//const version = require(path.resolve(__dirname, '../../package.json')).version;
const packageJsonPath = new URL('../../package.json', import.meta.url).pathname;
const { version } = JSON.parse(readFileSync(packageJsonPath, 'utf-8'));

const ERRORS_TO_IGNORE = [
"THIS_IS_UNDEFINED",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@ import commonjs from 'rollup-plugin-commonjs';
import nodeResolve from 'rollup-plugin-node-resolve';
import path from 'path';
import alias from '@rollup/plugin-alias';
import { fileURLToPath } from 'url';

// Define __dirname
const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);

const ERRORS_TO_IGNORE = [
"THIS_IS_UNDEFINED"
Expand Down

0 comments on commit 7e6b5e6

Please sign in to comment.