Skip to content

Compatibility with Browserify #27

@pgiraud

Description

@pgiraud

Jsonix cannot be bundled with Browserify.

I've tried to create a bundle with the following command:

browserify main.js -o bundle.js

The main.js file looks like the following:

var Jsonix = require('jsonix').Jsonix;
var context =  new Jsonix.Context([]);

The bundle.js file is created. However, when loaded in the browser, I
get the following error in my console:

Uncaught TypeError: Cannot read property 'apply' of undefined

The guilty line looks like the following:

return module.require.apply(module, arguments);

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions