-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(build): add fonts support to build
Use a task to add all the fonts in JSPM_packages inside the /fonts folder in dev and prod Linked to #2 (Issue stay open if we can try a more elegant solution)
- Loading branch information
1 parent
bbc9796
commit 87d48a7
Showing
5 changed files
with
32 additions
and
4 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import gulp from 'gulp'; | ||
import flatten from 'gulp-flatten'; | ||
|
||
let ext = ['eot', 'woff2', 'woff', 'ttf', 'svg']; | ||
|
||
gulp.task('fonts', () => | ||
gulp.src(ext.map(ext => `./jspm_packages/**/*.${ext}`)) | ||
.pipe(flatten()) | ||
.pipe(gulp.dest('./public/fonts/')) | ||
); |
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 |
---|---|---|
@@ -1,8 +1,13 @@ | ||
import gulp from 'gulp'; | ||
import sass from 'gulp-sass' | ||
import modifyCssUrl from 'gulp-modify-css-urls'; | ||
import paths from '../paths'; | ||
|
||
let modifyUrlOfFontUrl = {modify : (url) => '/fonts' + url.substr(url.lastIndexOf('/'))}; | ||
|
||
gulp.task('sass', () => | ||
gulp.src(['./public/**/*.scss', '!./public/jspm_packages/**/*.scss']) | ||
gulp.src(paths.glob.scss) | ||
.pipe(sass().on('error', sass.logError)) | ||
.pipe(modifyCssUrl(modifyUrlOfFontUrl)) | ||
.pipe(gulp.dest('./public')) | ||
); |
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 |
---|---|---|
@@ -1,2 +1,3 @@ | ||
$brand-primary: darken(#c800ca, 6.5%) !default; | ||
$icon-font-path: "/fonts/" !default; | ||
|
||
$brand-primary: darken(#c800ca, 6.5%) !default; |