Skip to content
This repository was archived by the owner on Dec 1, 2019. It is now read-only.

Commit 9e06e02

Browse files
add example, DRY regex, fix indentation
1 parent c2aa2b0 commit 9e06e02

File tree

3 files changed

+22
-2
lines changed

3 files changed

+22
-2
lines changed

Gruntfile.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ module.exports = function(grunt) {
5959
multipackage_partial_exclude: {
6060
options: {
6161
only: 'ProjectB/*',
62-
exclude: ['ProjectA/*'],
62+
exclude: ['ProjectA/*'],
6363
name: {
6464
ProjectB: 'test/fixtures/Project_B',
6565
ProjectA: 'test/fixtures/Project_A'

README.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,8 +145,28 @@ grunt.initConfig({
145145

146146
#### options.exclude
147147
Type: `Array`
148+
Syntax: `['PackageNameA/*'<, 'PackageNameB/*', ...>] `
148149

149150
The specific dependencies packages to exclude from the compilation.
151+
For example, adding `exclude: ['Core/*']` in the Gruntfile options would exclude all Core dependencies from output file.
152+
153+
```js
154+
grunt.initConfig({
155+
packager: {
156+
options: {
157+
name: {
158+
Core: 'js/mootools-core',
159+
More: 'js/mootools-more'
160+
},
161+
exclude: ['Core/*']
162+
},
163+
all: {
164+
'dest/mootools.js': 'Source/**.js',
165+
}
166+
}
167+
});
168+
```
169+
150170

151171
### Other Usage Examples
152172

tasks/packager.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ module.exports = function(grunt) {
170170
var toExclude = toArray(options.exclude);
171171
buffer = buffer.filter(function(def){
172172
var shouldKeep = toExclude.filter(function(dependency){
173-
var match = dependency.match(/([^\*]+)/);
173+
var match = dependency.match(PACKAGE_DOT_STAR);
174174
return match ? def.key.indexOf(match[1]) != 0 : true;
175175
});
176176
return shouldKeep.length;

0 commit comments

Comments
 (0)