This repository has been archived by the owner on Mar 31, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 254
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move other compilers over to Task subclasses
- Loading branch information
1 parent
f201410
commit c25f6c5
Showing
18 changed files
with
282 additions
and
260 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
class CombineTask extends Elixir.Task { | ||
/** | ||
* Create a new TestingTask instance. | ||
* | ||
* @param {string} name | ||
* @param {GulpPaths} paths | ||
*/ | ||
constructor(name, paths) { | ||
super(name, null, paths); | ||
} | ||
|
||
|
||
/** | ||
* Build the Gulp task. | ||
*/ | ||
gulpTask() { | ||
return ( | ||
gulp | ||
.src(this.src.path) | ||
.pipe(this.initSourceMaps()) | ||
.pipe(this.concat()) | ||
.pipe(this.minify()) | ||
.pipe(this.writeSourceMaps()) | ||
.pipe(this.saveAs(gulp)) | ||
.pipe(this.onSuccess('Assets Combined!')) | ||
); | ||
} | ||
|
||
|
||
/** | ||
* Register file watchers. | ||
*/ | ||
registerWatchers() { | ||
this.watch(this.src.path) | ||
.ignore(this.output.path); | ||
} | ||
} | ||
|
||
|
||
export default CombineTask; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
class CssTask extends Elixir.Task { | ||
/** | ||
* Create a new TestingTask instance. | ||
* | ||
* @param {string} name | ||
* @param {GulpPaths} paths | ||
* @param {object|null} options | ||
*/ | ||
constructor(name, paths, options) { | ||
super(name, null, paths); | ||
|
||
this.options = options; | ||
} | ||
|
||
|
||
/** | ||
* Build the Gulp task. | ||
*/ | ||
gulpTask() { | ||
return ( | ||
gulp | ||
.src(this.src.path) | ||
.pipe(this.initSourceMaps()) | ||
.pipe(this.compile()) | ||
.on('error', this.onError) | ||
.pipe(this.autoPrefix()) | ||
.pipe(this.concat()) | ||
.pipe(this.minify()) | ||
.pipe(this.writeSourceMaps()) | ||
.pipe(this.saveAs(gulp)) | ||
.pipe(this.onSuccess()) | ||
); | ||
} | ||
|
||
|
||
/** | ||
* Register file watchers. | ||
*/ | ||
registerWatchers() { | ||
this.watch(this.src.baseDir + Elixir.config.css[this.name].search) | ||
.ignore(this.output.path); | ||
} | ||
|
||
|
||
/** | ||
* Compile the CSS. | ||
*/ | ||
compile() { | ||
return Elixir.Plugins[this.name]( | ||
this.options || Elixir.config.css[this.name].pluginOptions | ||
); | ||
} | ||
} | ||
|
||
|
||
export default CssTask; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.