I have a question that I cannot find an answer to. I am currently creating a library for consumption, and I want to use requirejs to make it more modular. I have the following project structure ...
- example
- scripts
- otter
- libs
- signals
signals.js
- modules
subModule1.js
subModule2.js
otter.js
index.htm
- src
- libs (copied to example folder at build time)
- signals
signals.js
- modules
subModule1.coffee
subModule2.coffee
- otter.coffee
I want me to be able to require the signal.js file and any of my modules from any of my other files, without requiring an installation requiring installation, or without me, to find out how the project is installed during development.
For example, what I tried to do in my otter.coffee file is the following:
define ['/libs/signals/signals'], (signals) ->
This does not seem to work, since it is required not to find the signal.js file.
requirejs ? , , . i: e -
define (require) ->
signals = require './libs/signals/signals'
, ? ? ? , , config?
!
-
, main.js , ( ) ( 404 ). , , .
, main.js ...
...
paths: {
'otter': 'scripts/otter/otter'
}
...
. , , , . , otter.js...
define (require) ->
signals = require './libs/signals/signals'
require.js?