Skip to content

require.config(...) is being executed too late #126

@sscheidegger

Description

@sscheidegger

I am using an app (readium-js-viewer) which uses almond.js to load all modules. In index.html I am including the minified readium-js-viewer bundle, which includes almond.js:

<script type="text/javascript" src="scripts/readium-js-viewer_all_LITE.js"> </script>

Afterwards I am calling require.config() to provide some basic configuration to readium modules:

require.config({
    waitSeconds: 0,   
    config : {
        'readium_js_viewer/ModuleConfig' : {
                ...

However, every other time the app is not starting properly because the configuration is missing. It seems require.config() is sometimes being called too late, when the app already tries to access the config.

Using require.js, I could define var require = {waitSeconds: 0, config : ...} before loading require.js. However, this is not possible with almond.js.

Using almond.js, how am I supposed to make sure the config is being loaded before the app is trying to access it?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions