Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Does not work with Webpack #26

Open
douglasg14b opened this issue Dec 16, 2017 · 1 comment
Open

Does not work with Webpack #26

douglasg14b opened this issue Dec 16, 2017 · 1 comment

Comments

@douglasg14b
Copy link

douglasg14b commented Dec 16, 2017

I'm using typescript with webpack, and when instantiating Dexie, the export that's used is relationships.default.

import Dexie from 'dexie';
import relationships from 'dexie-relationships'

export class AppDatabase extends Dexie {
    constructor(){
        super('AppDatabase', {addons: [relationships]});
    }
}

After compilation and packing, {addons: [relationships]} turns into what is essentially {addons: [relationships.default]}.

image

Is this an error with the module, or an export?

@dfahlander
Copy link
Owner

The code is bundled using rollupjs as an umd module, treating default export differently than how webpack interprets it (rollup default exports are compatible with the var module = require('module') style) . We had the same problem with Dexie and solved it there by setting defaultExport.default = defaultExport. This made it work no matter using webpack or commonjs require. Should solve it the same way here.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants