Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

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

Open
sscheidegger opened this issue Feb 1, 2021 · 0 comments
Open

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

sscheidegger opened this issue Feb 1, 2021 · 0 comments

Comments

@sscheidegger
Copy link

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?

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

No branches or pull requests

1 participant