I am trying to load the ace editor from a CDN with requirejs.
Here is a plunkr which illustrates my problem. Ace is not defined in the following case:
requirejs.config({
paths: { ace: ['//cdnjs.cloudflare.com/ajax/libs/ace/1.1.9/ace'] }
})
$('h1').text("loading ace...");
requirejs([ 'ace'], function(ace) {
$('h1').text("ace loaded.")
console.log(ace)
ace.edit('#editor')
return
})
you need to define ace as a path to the folder that contains
ace.js
and require "ace/ace"