Beta ###An easier way to import, remove and create modules for the RequireJS module loader.
Based on settings in a configuration file the plugin will parse your source folders and index your modules, enabling it to automate basic parts of your module handling.
Importing modules is done through a quick search among the indexed modules. When selected for import the modules path as well as reference variable is automatically added to the ‘define’ statement.
Creating new modules is made easier by quick search of packages(folders), adding custom module templates and auto import of predefined modules.
SublimeRJS supports script as well as text modules.
Please see the following screencast for a quick feature demonstration. http://youtu.be/6_CDony1jjQ
- Add to project
Right click your project folder and clickAdd SublimeRJS
. This will add the configuration file to your project.
Edit the configuration according to your project. Save. - Menu
Presscmd + m
/ctrl + m
to open the main menu. This will give you all the options in the quick panel. - Open module
PressCmd+Shift+[7-9])
/Ctrl+Shift+[7-9]
to open a module in specific column view.
{
"script_folder": "js",
"text_folder":"templates",
"require_main":"js/main.js",
"aliases": {
"jquery":"$",
"underscore":"_"
},
"auto_add":[
"jquery",
"underscore",
"event/eventBus"
],
"script_group":"0",
"text_group":"1"
"module_templates":"module_templates",
"excludes": [
"js/text.js",
"js/libs"
],
"texts_name":"texts",
"list_modules":"true"
}
"script_folder":"js",
"text_folder":"templates"
Defines the folders that should be indexed. Relative to the config file.
"require_main":"js/main.js"
Reference to the RequireJS main file. Relative to the config file.
"aliases": {
"jquery":"$",
"underscore":"_"
}
Aliases to apply when adding modules to the define()
statment.
"auto_add":[
"jquery",
"underscore",
"event/eventBus"
]
Modules that will be automatically added when creating a new module.
"script_group":"0",
"text_group":"1"
Sets in which column the module type should be opened.
"module_templates":"module_templates"
Specify folder for your module templates.
"excludes": [
"js/text.js",
"js/libs"
]
Files and library’s not to include when listing modules
"texts_name":"texts"
Allows you to set the name of the text-module path-shorthand. For example text!texts/dir/file.html where 'templates' is defined by texts_name. Primarily used when adding SublimeRJS to existing projects.
"list_modules":"true"
Setting this to true will add a comment block under your define statement listing all dependencies for the module and the related file.
Download, unzip and move to the Packages
folder of Sublime Text 2.
- Method code hints across modules
- Jump to module definition
- Support for environment variables in module templates
- Multiple script/text folders
- Optimizer launcher
- Add support for 'require()'
SublimeRJS is currently at an early stage. It is not recommended to use this for production purpose. All use is at own risk.
Should you choose to look at the source code I should probably advise you that this was my first Python project, and the code will look pretty messy to the experienced Python developer.