browserify中的ckeditor:主目录错误

browserify中的ckeditor:主目录错误,ckeditor,browserify,Ckeditor,Browserify,在package.json中: "browser": { "ckeditor": "./public/ckeditor/ckeditor.js", "bootstrap": "./public/bootstrap/js/bootstrap.js" } 在源browserifycoffee脚本文件中: $ = jQuery = require 'jqu

package.json
中:

"browser": {
        "ckeditor": "./public/ckeditor/ckeditor.js",
        "bootstrap": "./public/bootstrap/js/bootstrap.js"
      }
在源
browserify
coffee脚本
文件中:

$  = jQuery = require 'jquery-browserify'
ckeditor = require 'ckeditor'
jqueryCkeditor = require '../ckeditor/adapters/jquery.js'
$('#Info').ckeditor()
chrome浏览器控制台中的错误:

Failed to load resource: the server responded with a status of 404 (Not Found) http://localhost:4042/config.js?t=E7KD
Failed to load resource: the server responded with a status of 404 (Not Found) http://localhost:4042/skins/moono/editor.css?t=E7KD
Failed to load resource: the server responded with a status of 404 (Not Found) http://localhost:4042/lang/en.js?t=E7KD
Uncaught TypeError: Cannot set property 'dir' of undefined ckeditor.js:219
Failed to load resource: the server responded with a status of 404 (Not Found) http://localhost:4042/skins/moono/editor.css?t=E7KD
似乎
ckeditor
可以找到它的主目录:
/ckeditor
。如何帮助它

更新 工作源代码:

$ = jQuery = require 'jquery'
window.CKEDITOR_BASEPATH = '/ckeditor/'

ckeditor = require 'ckeditor'
jqueryCkeditor = require '../ckeditor/adapters/jquery.js'
$ ->
    CKEDITOR.replace("Info")

可能需要手动指定路径-


您确定在包含CKEditor之前设置了该变量吗?因为我几乎可以肯定,如果CKEditor脚本可以访问该变量,应该会发生一些变化?也许您需要确保它确实是全局的(所以使用
window.CKEDITOR\u BASEPATH
或类似的东西)?
window.CKEDITOR_BASEPATH = './public/ckeditor/';