Skip to content

khanhpti/grunt-esri-slurp

 
 

Repository files navigation

Build Status Dependency Status NPM version

esri-slurp may the slource™ be with you!

Download and unwind esri js api amd modules and css to create a local package for builds, testing, and continuous integration. The best way to get the slource™.

Getting Started

This plugin requires Grunt.

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-esri-slurp --save-dev

Once the plugin has been installed, it may be enabled inside your Gruntfile with this line of JavaScript:

grunt.loadNpmTasks('grunt-esri-slurp');

The "esri_slurp" task

Overview

In your project's Gruntfile, add a section named esri_slurp to the data object passed into grunt.initConfig().

module.exports = function (grunt) {
  grunt.initConfig({
    esri_slurp: {
      options: {
        version: '3.11'
      },
      dev: {
        options: {
          beautify: true
        },
        dest: 'src/esri'
      },
      travis: {
        dest: 'src/esri'
      }
    }
  });

  grunt.loadNpmTasks('grunt-esri-slurp');

  grunt.registerTask('slurp', ['esri_slurp:dev']);
  grunt.registerTask('travis', ['esri_slurp:travis']);
};

Options

options.version

Type: String Default value: null

A string value representing the version of the esri js api to download.

options.beautify

Type: Boolean Default value: false

A boolean value to make the js and css code beautiful.

Files

files.dest

Type: String Default value: null

A string value letting grunt know where to put the downloaded files.

Examples

For examples for working with grunt-esri-slurp please browse the AGRC JavaScript BoilerPlate project as well as @TomWayson's simple slurp example.

Release History

1.1.0 Added esri 3.11 modules

1.0.0 changed packageLocation -> dest and removed default value. This follows the grunt conventions and makes slurp work with other plugins like grunt-if-missing. Removed the default value for the version property. Added css beautification.

0.6.0 esri_slurp is now a multi-task in order to have target level options.

0.5.0 Added js-beautify option. esriModuleBuilder task now works on windows. 3.10 module list now in plugin.

0.4.0: Added progress bar and task to build module list. Stored 3.8 and 3.9 modules by default. Anything earlier and you'll have to run it yourself.

0.3.0: Fixed async code and should now run on multiple os's.

0.2.0: Split up the defines so packages can be required again.

0.1.0: Can download modules to a specified location.

License

Copyright (c) 2014 steveoh. Licensed under the MIT license.

About

download the esri js api

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 100.0%