Grunt plugin task to handle compiling rapydscript to javascript.
This plugin requires Grunt and RapydScript.
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 git://github.com/loolmeh/grunt-rapydscript.git --save-dev
npm install -g rapydscript
Once the plugin has been installed, it may be enabled inside your Gruntfile with this line of JavaScript:
grunt.loadNpmTasks('grunt-rapydscript');
In your project's Gruntfile, add a section named rapydscript
to the data object passed into grunt.initConfig()
.
grunt.initConfig({
rapydscript: {
options: {
// Task-specific options go here.
},
your_target: {
// Target-specific file lists and/or options go here.
},
},
})
Type: Boolean
Default value: false
Sets the following flag:
--screw-ie8 Pass this flag if you don't care about full
compliance with Internet Explorer 6-8 quirks (by
default RapydScript will try to be IE-proof).
Type: Boolean
Default value: false
Sets the following flag:
-b, --bare Remove the module wrapper that prevents RapydScript
scope from bleeding into other JavaScript logic.
Type: Boolean
Default value: false
Sets the following flag:
-n, --namespace-imports Import files into separate modules like Python
instead of concatenating them [experimental].
Type: Boolean
Default value: false
Sets the following flag:
-i, --auto-bind Automatically bind function methods to functions
themselves instead of using @bound decorator
[experimental].
Type: Boolean
Default value: true
Sets the following flag:
-p, --prettify Prettify output/specify output options.
Type: Boolean
Default value: false
Sets the following flag:
-m, --omit-baselib Omit baselib functions (use this if you have a
different way of ensuring they're imported, such as
including baselib.js).
Type: Boolean
Default value: false
Sets the following flag:
-t, --test Run RapydScript tests
Type: Boolean
Default value: true
Sets the following flag:
--comments Preserve copyright comments in the output. By
default this works like Google Closure, keeping
JSDoc-style comments that contain "@license" or
"@preserve". You can optionally pass one of the
following arguments to this flag:
- "all" to keep all comments
- a valid JS regexp (needs to start with a slash) to
keep only comments that match.
Note that currently not *all* comments can be kept
when compression is on, because of dead code removal
or cascading statements into sequences. [string]
Type: Boolean
Default value: true
Sets the following flag:
--stats Display operations run time on STDERR.
Type: Boolean
Default value: true
Sets the following flag:
-v, --verbose Verbose
Type: Boolean
Default value: false
uses sed to clean up compiled single lines with strings as the only thing there:
sed -i '/^\s*".*";$/d' file.js
see the Gruntfile.js in this project for a working default config.
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.
- v0.0.1 initial release
Copyright (c) 2014 loolmeh. Licensed under the MIT license.