Number
representing a enum value of regexKind
--or--String
representing a enum value of regexKind
--or--
Complete or partial object matching IMatchOpt options that determine how build_include matches are found.
Any omitted values are included from the values of default match MatchBuildInclude
When needed custom expressions can be written into a task using the match
option.match
follows the inteface IMatchOpt.
Any omitted values are included from the values of default match MatchBuildInclude
It is also possible to merge current matches with new values.
See example below
File level options will always take priority unless override is set to true
.
See Also: IBiGruntOpt
Matches built in match rules of MatchBuildIncludeSlash by seting match to string value of regexKind.buildIncludeSlash
module.exports = function (grunt) {
grunt.initConfig({
build_include: {
default: {
options: {
match: 'BuildIncludeSlash'
},
src: './src/maint.ts',
dest: './scratch/ts/main.ts'
}
}
});
grunt.loadNpmTasks('grunt-build-include');
grunt.registerTask('default', ['build_include:default']);
};
// BUILD_INCLUDE(filePath)
// BUILD_INCLUDE(filePath)[options]
// BUILD_INCLUDE(filePath)
[options]
See Also: Class MatchBuildIncludeSlash
Matches built in match rules of MatchBuildIncludeSlash by seting match to numeric value of regexKind.buildIncludeSlash
module.exports = function (grunt) {
grunt.initConfig({
build_include: {
default: {
options: {
match: 3
},
src: './src/maint.ts',
dest: './scratch/ts/main.ts'
}
}
});
grunt.loadNpmTasks('grunt-build-include');
grunt.registerTask('default', ['build_include:default']);
};
// BUILD_INCLUDE(filePath)
// BUILD_INCLUDE(filePath)[options]
// BUILD_INCLUDE(filePath)
[options]
See Also: Class MatchBuildIncludeSlash
Matchs options such as:# INCLUDE_BUILD(scratch/main.ts)
#include_build(scratch/modules/myfile.ts)
The Regex will example can be see on regexr.com
module.exports = function (grunt) {
grunt.initConfig({
build_include: {
default: {
options: {
match: {
name: 'include_build',
parameters: `(?:\\[(.*)\\])?`,
prefix: '(?:(?:#))[ \\t]*',
suffix: ''
}
},
src: './src/maint.ts',
dest: './scratch/ts/main.ts'
}
}
});
grunt.loadNpmTasks('grunt-build-include');
grunt.registerTask('default', ['build_include:default']);
};
Matchs options such as:---- minus_plus[scratch/main.ts] ++++
----minus_plus[scratch/modules/myfile.ts]{options}++++
The Regex will example can be see on regexr.com
NOTE: This match would not be able to apply indent due to the Regular Expression
starting at the beginning of line as indicated by the prefix
starting with ^
.
module.exports = function (grunt) {
grunt.initConfig({
build_include: {
default: {
options: {
match: {
name: 'minus_plus',
fileName: `\\[(?:[ ]+)?(?:['"])?(.*?)(?:['"](?:[ ]+)?)?\\]`,
parameters: `(?:\\{(.*)\\})?`,
prefix: '^----[ ]*',
suffix: '(?:(?:[ ]+)?\\+\\+\\+\\+(?:(?:$)|(?:[\\r\\n]+)))',
options: 'im'
}
},
src: './src/maint.ts',
dest: './scratch/ts/main.ts'
}
}
});
grunt.loadNpmTasks('grunt-build-include');
grunt.registerTask('default', ['build_include:default']);
};
This example shows how match
can merge with other built in matches.
By setting kind
value to buildIncludeHtml this match
will match all the values of MatchBuildIncludeHtml
excpet will match on name BUILD_HTML
instead of default value of MatchBuildIncludeHtml.name which is BUILD_INCLUDE
.
Matchs options such as:<!-- BUILD_HTML(scratch/main.ts) -->
<!-- BUILD_HTML(scratch/modules/myfile.ts) -->
module.exports = function (grunt) {
grunt.initConfig({
build_include: {
default: {
options: {
match: {
kind: 'buildIncludeHtml',
name: 'BUILD_HTML'
}
},
src: './src/maint.ts',
dest: './scratch/ts/main.ts'
}
}
});
grunt.loadNpmTasks('grunt-build-include');
grunt.registerTask('default', ['build_include:default']);
};
Generated using TypeDoc