-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(sass): Allow modules to specify sass options, such as includePaths
- Loading branch information
1 parent
f6e35c1
commit 37460f0
Showing
6 changed files
with
180 additions
and
13 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -22,6 +22,7 @@ public function getTestGulpfileDataProvider() | |
'test1', | ||
'test2', | ||
'test3', | ||
'test4', | ||
]); | ||
} | ||
|
||
|
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,111 @@ | ||
const {src, dest, parallel, watch} = require("gulp"); | ||
const sass = require("gulp-sass"); | ||
const minifyCSS = require("gulp-csso"); | ||
const concat = require("gulp-concat"); | ||
const uglify = require('gulp-uglify'); | ||
|
||
const main_css_src = [ | ||
"foo.scss", | ||
"bar/baz.scss" | ||
]; | ||
exports.main_css = function () { | ||
return src(main_css_src, {sourcemaps: true}) | ||
.pipe(concat("main.min.css")) | ||
.pipe(sass({ | ||
"includePaths": [ | ||
"awesome-css-module" | ||
] | ||
})) | ||
.pipe(minifyCSS()) | ||
.pipe(dest("public/static/css", {sourcemaps: "."})); | ||
}; | ||
exports.main_css_watch = function () { | ||
watch(main_css_src, function (cb) { | ||
exports.main_css(); | ||
cb(); | ||
}); | ||
}; | ||
|
||
const main_js_src = [ | ||
"script.js", | ||
"stuff/**/*.js" | ||
]; | ||
exports.main_js = function () { | ||
return src(main_js_src, {sourcemaps: true}) | ||
.pipe(concat("main.min.js")) | ||
.pipe(uglify()) | ||
.pipe(dest("public/static/js", {sourcemaps: "."})); | ||
}; | ||
exports.main_js_watch = function () { | ||
watch(main_js_src, function (cb) { | ||
exports.main_js(); | ||
cb(); | ||
}); | ||
}; | ||
|
||
const main_other_src = [ | ||
"foo.png", | ||
"bar/**/*.jpg" | ||
]; | ||
exports.main_other = function () { | ||
return src(main_other_src) | ||
.pipe(dest("public/static")); | ||
}; | ||
exports.main_other_watch = function () { | ||
watch(main_other_src, function (cb) { | ||
exports.main_other(); | ||
cb(); | ||
}); | ||
}; | ||
|
||
exports.main = parallel(exports.main_css, exports.main_js, exports.main_other); | ||
exports.main_watch = parallel(exports.main_css_watch, exports.main_js_watch, exports.main_other_watch); | ||
|
||
const admin_css_src = [ | ||
"foo.scss", | ||
"bar/admin.scss" | ||
]; | ||
exports.admin_css = function () { | ||
return src(admin_css_src, {sourcemaps: true}) | ||
.pipe(concat("admin.min.css")) | ||
.pipe(sass()) | ||
.pipe(minifyCSS()) | ||
.pipe(dest("public/static/css", {sourcemaps: "."})); | ||
}; | ||
exports.admin_css_watch = function () { | ||
watch(admin_css_src, function (cb) { | ||
exports.admin_css(); | ||
cb(); | ||
}); | ||
}; | ||
|
||
const admin_js_src = [ | ||
"admin.js" | ||
]; | ||
exports.admin_js = function () { | ||
return src(admin_js_src, {sourcemaps: true}) | ||
.pipe(concat("admin.min.js")) | ||
.pipe(uglify()) | ||
.pipe(dest("public/static/js", {sourcemaps: "."})); | ||
}; | ||
exports.admin_js_watch = function () { | ||
watch(admin_js_src, function (cb) { | ||
exports.admin_js(); | ||
cb(); | ||
}); | ||
}; | ||
|
||
exports.admin = parallel(exports.admin_css, exports.admin_js); | ||
exports.admin_watch = parallel(exports.admin_css_watch, exports.admin_js_watch); | ||
|
||
exports.css = parallel(exports.main_css, exports.admin_css); | ||
exports.css_watch = parallel(exports.main_css_watch, exports.admin_css_watch); | ||
|
||
exports.js = parallel(exports.main_js, exports.admin_js); | ||
exports.js_watch = parallel(exports.main_js_watch, exports.admin_js_watch); | ||
|
||
exports.other = parallel(exports.main_other); | ||
exports.other_watch = parallel(exports.main_other_watch); | ||
|
||
exports.default = parallel(exports.css, exports.js, exports.other); | ||
exports.watch = parallel(exports.css_watch, exports.js_watch, exports.other_watch); |
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,30 @@ | ||
{ | ||
"main": { | ||
"css": [ | ||
"foo.scss", | ||
"bar/baz.scss" | ||
], | ||
"js": [ | ||
"script.js", | ||
"stuff/**/*.js" | ||
], | ||
"other": [ | ||
"foo.png", | ||
"bar/**/*.jpg" | ||
], | ||
"sass_options": { | ||
"includePaths": [ | ||
"awesome-css-module" | ||
] | ||
} | ||
}, | ||
"admin": { | ||
"css": [ | ||
"foo.scss", | ||
"bar/admin.scss" | ||
], | ||
"js": [ | ||
"admin.js" | ||
] | ||
} | ||
} |
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