Rump Scriptsify
Status
Master
Develop
About
Rump Scriptsify is a Rump module for handling and building scripts with Browserify/Watchify, offering a lot of flexibility and configuration to author your scripts. For more information, visit the core repository.
API
The following is appended to the core Rump API:
rump.addGulpTasks(options)
This module adds the following tasks:
build:scripts
will process and build scripts with Browserify. For more information on source and destination paths seerump.configure()
below. This task is also added to thebuild
task for single builds as well as thewatch
task for continuous builds.info:scripts
will display information on what this specific module does, specifically the source and destination paths as well as what files would get processed. This task is also added to theinfo
task.
rump.configure(options)
Redefine options for Rump and Rump modules to follow. In addition to what options Rump and other Rump modules offer, the following options are available alongside default values:
options.paths.source.scripts
('scripts'
)
This is the directory where scripts to be processed are contained. This path is
relative to the root source path. (If the default root and scripts path is
used, then the path would be src/scripts
)
options.paths.destination.scripts
('scripts'
)
This is the directory where processed scripts are copied to. This path is
relative to the root destination path. (If the default root and scripts path is
used, then the path would be dist/scripts
)
options.globs.build.scripts
('*.js'
)
This specifies which scripts to process.
options.scripts.minify
(options.environment === 'production'
)
This specifies whether to minify and uglify generated JS. (minified if true
)
By default JS is minified only if the environment is set to production. (visit
the main Rump repository for more information on environment)
options.scripts.sourceMap
(options.environment === 'development'
)
This specifies whether to include inline source maps to generated JS. (source
maps included if true
) By default source maps are included only if the
environment is set to development. (visit the main Rump repository for more
information on environment)
options.scripts.browserify
This specifies any options you want to override/set up when intializing a Browserify bundle.
options.scripts.transforms
([]
)
This specifies a list of transforms that will be applied to Browserify bundles.
options.scripts.plugins
([]
)
This specifies a list of plugins that will be applied to Browserify bundles.
options.scripts.uglifyjs
This specifies options that are sent to UglifyJS through Webpack when minifying. The default options set are:
output: comments: false compress: drop_console: true drop_debugger: true
rump.configs.browserify
, rump.configs.uglifyjs
This contains the generated options that are passed to Browserify and UglifyJS, respectively, in the Gulp task. This is a good way to see what options are generated based on defaults and overrides.
Plugins/Transforms
The following plugins/transforms are used by default for builds:
bundle-collapser
is used in non-watch production builds to reduce the size of builds.unreachable-branch-transform
is used in production builds to remove dead code.