Resolve dependencies of a Sencha ExtJS project.
This plugin requires Grunt ~0.4.1
and Phantomjs ~1.9.0
If you haven't used Grunt before, be sure to check out the Getting Started guide, as it explains how to create a Gruntfile as well as install and use Grunt plugins. Once you're familiar with that process, you may install this plugin with this command:
npm install grunt-sencha-resolver --save-dev
One the plugin has been installed, it may be enabled inside your Gruntfile with this line of JavaScript:
grunt.loadNpmTasks('grunt-sencha-resolver');
In your project's Gruntfile, add a section named sencha_resolver
to the data object passed into grunt.initConfig()
.
grunt.initConfig({
sencha_resolver: {
options: {
// Task-specific options go here.
},
},
})
Type: String
Default value: 'http://127.0.0.1'
This is the URL to call to check Sencha ExtJS dependencies (scripts files).
Type: Object
Default value: '{}'
An object that define mapping of caught scripts, using regexp.
Type: Boolean
Default value: 'false'
A boolean that tell the task to delete references of any ExtJS core library (Ext-debug.js, Ext-all.js etc...).
In this example, we target an url of a running ExtJS project and extract all it's script dependencies. We then map to local storage path some of the obtained URLs, using regexp. We also want to remove the Ext-all-debug.js library.
grunt.initConfig({
sencha_resolver: {
options: {
url: 'http://127.0.0.1/awesomeExtJSproject',
urlMappings: {
'.*www/': '/home/awesome_developper/dev/awesome_extjs_project/www/',
'\\?(.*)': ''
},
skipSenchaCore: true
},
},
})
In lieu of a formal styleguide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality. Lint and test your code using Grunt.
(Nothing yet)