You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Sep 6, 2021. It is now read-only.
We should include the require.js text plugin with Brackets. This plugin allows developers to load text files in the same way that they load other JavaScript modules.
Notice that text.js is included in the project. You can then use the plugin like so:
var menuTemplate = require("text!menu.template");
Ideally, this will be included in Brackets so every extension developer doesn't have to include it.
I did a quick test and placed text.js in the brackets directory, and then tried to use it like so:
var menuTemplate = brackets.getModule("text!extensions/user/StringConvert/menu.template");
However, this generated the following error:
Uncaught Error: Module name 'text!extensions/user/StringConvert/menu.template' has not been loaded yet for context: _
http://requirejs.org/docs/errors.html#notloaded
Which I believe has something to do with the text plugin / module not being loaded yet. See the comment for the getModule definition in brackets.js
// Also store our current require.js context (the one that loads brackets core modules) so that extensions can use it// Note: we change the name to "getModule" because this won't do exactly the same thing as 'require' in AMD-wrapped// modules. The extension will only be able to load modules that have already been loaded once.brackets.getModule=require;
The text was updated successfully, but these errors were encountered:
We should include the require.js text plugin with Brackets. This plugin allows developers to load text files in the same way that they load other JavaScript modules.
http://requirejs.org/docs/download.html#text
Currently, if you want to use this as an extension developer, you have to include the plugin with your extension:
For example:
https://github.com/mikechambers/StringConvert
Notice that text.js is included in the project. You can then use the plugin like so:
Ideally, this will be included in Brackets so every extension developer doesn't have to include it.
I did a quick test and placed text.js in the brackets directory, and then tried to use it like so:
However, this generated the following error:
Which I believe has something to do with the text plugin / module not being loaded yet. See the comment for the getModule definition in brackets.js
The text was updated successfully, but these errors were encountered: