Compile spider script into javascript.
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-spider-script --save-dev
Once the plugin has been installed, it may be enabled inside your Gruntfile with this line of JavaScript:
grunt.loadNpmTasks('grunt-spider-script');
In your project's Gruntfile, add a section named spider_script
to the data object passed into grunt.initConfig()
.
grunt.initConfig({
spider_script: {
options: {
// Task-specific options go here.
},
your_target: {
// Target-specific file lists and/or options go here.
},
},
})
Type: Boolean
Default: true
Generates sourcemaps next to compiled javascript files.
Type: String
Default: ES5
Which ECMAScript version to compile for. See spider documentation.
Type: Boolean
Default: true
Determines if "use strict" should be enforced.
Type: String
Default: grunt linefeed
Concatenated files will be joined with this string.
grunt.initConfig({
spider_script: {
files: {
'js/script.js': 'spider/script.spider'
}
}
})
Note: sourcemaps will be disabled.
grunt.initConfig({
spider_script: {
files: {
'js/script.js': ['spider/script.spider', 'spider/script2.spider']
}
}
})
grunt.initConfig({
spider_script: {
options: {},
files: [{
expand: true,
cwd: 'spiders',
src: ['*.spider'],
dest: 'js/',
ext: '.js'
}]
}
})
grunt.initConfig({
spider_script: {
options: {
target: 'ES6'
},
files: {
'js/script.js': 'spider/script.spider'
}
}
})
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.
- 2014-11-29 v0.0.9 Remove traceur dependency.
- 2014-11-29 v0.0.8 Update spider-script to spider-script 0.1.3. Add option to compile for ES5/6. Remove banner option.
- 2014-11-19 v0.0.7 Update spider-script to spider-script 0.0.7.
- 2014-11-19 v0.0.5 Update spider-script. Allow custom sourcemap source file.
- 2014-11-17 v0.0.4 Make spider-script dependency less strict
- 2014-11-17 v0.0.3 Support concatenation and file expanding
- 2014-11-17 v0.0.2 Add support for source maps and use strict mode
- 2014-11-17 v0.0.1 Initial release.
Copyright (c) 2014 Marius Craciunoiu. Licensed under the MIT license.