You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Dec 1, 2019. It is now read-only.
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-mootools-packager --save-dev
Once the plugin has been installed, it may be enabled inside your Gruntfile with this line of JavaScript:
grunt.loadNpmTasks('grunt-mootools-packager');
The "packager" task
Overview
In your project's Gruntfile, add a section named packager to the data object passed into grunt.initConfig().
grunt.initConfig({packager: {options: {name: 'Core'// Package name. (todo: use package.json)},your_target: {// Target-specific file lists and/or options go here.'mootools-all.js': 'Source/**.js'},},});
Options
options.strip
Type: String or Array<String|RegExp>
Default value: false
A single, or multiple, strings or regexp to remove from the combined code.
options.separator
Type: String
Default value: grunt.util.linefeed
The delimeter to join all the source files together.
options.callback
Type: Function
The function to be called when compilation is finished. The compiled content will passed as the first argument in the callback function.
options.noOutput
Type: Boolean
If true no files will be written. Defaults to false.
options.name
Type: String or Object
The package name. TODO: Use package.json.
The name of the package, or, if there are multiple packages being built, an
object with the names and paths to their source files.
The specific components or packages to compile (with their dependencies).
NOTE: You can specify the .only value in the .options and it will apply to all
configurations globally, but you can also specify an .only value for each configuration.
This allows you to build numerous libraries with specific requirements.
grunt.initConfig({packager: {options: {name: {Core: 'js/mootools-core',More: 'js/mootools-more'}},// all of both librariesall: {src: ['js/mootools-core/Source/**/*.js','js/mootools-more/Source/**/*.js'],dest: 'mootools.js'},// the Form.Validator component and its requirementsformValidator: {src: ['js/mootools-core/Source/**/*.js','js/mootools-more/Source/**/*.js'],only: ['More/Form.Validator']dest: 'form.validator.js'},// all of the More package and its requirementsallOfMore: {src: ['js/mootools-core/Source/**/*.js','js/mootools-more/Source/**/*.js'],only: ['More/*']dest: 'more.js'}},});