Skip to content
This repository has been archived by the owner on Jun 12, 2018. It is now read-only.

Commit

Permalink
[chore] build svg as srpites from webpack
Browse files Browse the repository at this point in the history
  • Loading branch information
m4dz committed Oct 12, 2016
1 parent f4f4188 commit 80ba7b7
Show file tree
Hide file tree
Showing 8 changed files with 13 additions and 5 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,5 @@ locales
!build/server/locales

client/public

!.gitkeep
Empty file.
6 changes: 3 additions & 3 deletions client/app/styles/components/_icons.styl
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@
margin 1em auto

&.google-services
background-image url('../assets/img/sprites/google-services-sprite.png')
background-image url('../assets/img/google-services-sprite.png')
background-position 0 0

&.calendar-contacts
background-image url('../assets/img/sprites/cozy-icons-sprite.svg')
background-image url('../assets/img/cozy-icons-sprite.svg')
background-position -384px 0

// google icons
Expand All @@ -19,7 +19,7 @@
height 48px
width 48px
@extend $marged-hz-01
background-image url('../assets/img/sprites/google-services-sprite.png')
background-image url('../assets/img/google-services-sprite.png')

&.gmail
background-position -120px 0
Expand Down
2 changes: 1 addition & 1 deletion client/app/styles/components/_popup.styl
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ header
height $header-size
border-radius 100%
background-color #ffffff
background-image url('../assets/img/sprites/cozy-icons-sprite.svg')
background-image url('../assets/img/cozy-icons-sprite.svg')
background-position 0 0
@extend $shadow-depth-01

Expand Down
7 changes: 6 additions & 1 deletion client/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,14 @@ var loaders = [
test: /\.json$/,
loader: 'json'
},
{
test: /\.svg$/,
include: /sprites/,
loader: 'svg-sprite?name=[name]_[hash]'
},
{
test: /\.(png|gif|jpe?g|svg)$/i,
exclude: /vendor/,
exclude: /(vendor|sprites)/,
loader: 'file?name=' + imgPath
}
];
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@
"npm-run-all": "1.7.0",
"rewire": "2.5.1",
"sinon": "1.17.4",
"svg-sprite-loader": "0.0.29",
"webpack": "1.12.15",
"xmlhttprequest": "1.8.0"
},
Expand Down

0 comments on commit 80ba7b7

Please sign in to comment.