Skip to content

Commit 564729f

Browse files
committed
import font-awesome to public assets on build
1 parent dec2db2 commit 564729f

File tree

3 files changed

+18
-2
lines changed

3 files changed

+18
-2
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
# Project gitignore
2+
public
23
src/config/settings.json
34
.env
45
*.min.*

gulpfile.js

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,11 @@ const appPort = process.env.PORT
44
const devPort = process.env.PORT_DEV
55
const css = 'src/views/*.css'
66
const htmlTemplate = 'src/views/**/*.hbs'
7+
const publicAssets = 'src/views/public'
8+
const destination = {
9+
css: publicAssets + '/css',
10+
fonts: publicAssets + '/fonts'
11+
}
712

813
const gulp = require('gulp')
914
const postcss = require('gulp-postcss')
@@ -20,10 +25,19 @@ gulp.task('build:css', () => {
2025
.pipe(rename({suffix: '.min'}))
2126
.pipe(postcss([autoprefixer()]))
2227
.pipe(cleanCSS())
23-
.pipe(gulp.dest('src/views/public/css'))
28+
.pipe(gulp.dest(destination.css))
2429
.pipe(bs.stream())
2530
})
2631

32+
gulp.task('import', ['font-awesome'])
33+
34+
gulp.task('font-awesome', () => {
35+
gulp.src('node_modules/font-awesome/css/font-awesome.min.css')
36+
.pipe(gulp.dest(destination.css))
37+
gulp.src('node_modules/font-awesome/fonts/*')
38+
.pipe(gulp.dest(destination.fonts))
39+
})
40+
2741
gulp.task('nodemon', done => {
2842
let start = false
2943
return nodemon({

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
"eslint": "./node_modules/.bin/eslint"
1717
},
1818
"scripts": {
19-
"build": "gulp build",
19+
"build": "gulp build && gulp import",
2020
"prestart": "npm run build",
2121
"start": "nf start",
2222
"dev": "npm run build && nf run gulp browser-sync",
@@ -32,6 +32,7 @@
3232
"express": "4.14.0",
3333
"express-handlebars": "3.0.0",
3434
"express-session": "1.14.2",
35+
"font-awesome": "4.7.0",
3536
"foreman": "2.0.0",
3637
"inherit": "2.2.6",
3738
"morgan": "1.7.0",

0 commit comments

Comments
 (0)