RequireJS not loading a file or module named “module.js”

前端 未结 2 1011
温柔的废话
温柔的废话 2021-01-24 17:23

I just started using RequireJS. I tried a simple code but one way works but the other doesn\'t.

folder \"script\" has \"main.js\", \"module.js\", \"require.js\"

2条回答
  •  半阙折子戏
    2021-01-24 18:08

    I continued reading the documentation:

    http://requirejs.org/docs/api.html

    and it led to a github that has information about this:

    https://github.com/jrburke/requirejs/wiki/Differences-between-the-simplified-CommonJS-wrapper-and-standard-AMD-define#magic

    It turns out that "module" is a kind of "magic modules" along as "require", "export".

    And "module" ... :

    gives you information about the module ID and location of the current module

    https://github.com/jrburke/requirejs/wiki/Differences-between-the-simplified-CommonJS-wrapper-and-standard-AMD-define#module

提交回复
热议问题