Skip to content

Add to website docs: load with requirejs #51

@webketje

Description

@webketje

I wanted to use Knockout punches with requirejs and wondered why a second version of Knockout was being queued; I don't know whether this is evident to frequent require.js users (and I probably won't make the same mistake again), but it took me a while to realize that the module name needed to be changed when (1) knockout.js is not a direct child file of the path defined as baseUrl in the require.js config, or (2), the knockout.js file is defined, eg as ko in the paths config property.

Eg, for (1), my config says the following:

paths: {
   lib: 'lib'
}

And I referenced Knockout in define/require calls like so:

define(['lib/knockout'], function(ko) { ... })

So might be worth mentioning on the website.

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