Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Boxiang Sun
gitlab-ce
Commits
7d68ac70
Commit
7d68ac70
authored
Jul 29, 2019
by
Mike Greiling
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use file-loader to import icon sprites
parent
7064d48e
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
1 deletion
+11
-1
app/assets/javascripts/vue_shared/components/icon.vue
app/assets/javascripts/vue_shared/components/icon.vue
+3
-1
config/webpack.config.js
config/webpack.config.js
+8
-0
No files found.
app/assets/javascripts/vue_shared/components/icon.vue
View file @
7d68ac70
<
script
>
import
iconsPath
from
'
@gitlab/svgs/dist/icons.svg
'
;
// only allow classes in images.scss e.g. s12
const
validSizes
=
[
8
,
10
,
12
,
14
,
16
,
18
,
24
,
32
,
48
,
72
];
let
iconValidator
=
()
=>
true
;
...
...
@@ -84,7 +86,7 @@ export default {
computed
:
{
spriteHref
()
{
return
`
${
gon
.
sprite_icons
}
#
${
this
.
name
}
`
;
return
`
${
iconsPath
}
#
${
this
.
name
}
`
;
},
iconTestClass
()
{
return
`ic-
${
this
.
name
}
`
;
...
...
config/webpack.config.js
View file @
7d68ac70
...
...
@@ -156,8 +156,16 @@ module.exports = {
exclude
:
/node_modules/
,
loader
:
'
graphql-tag/loader
'
,
},
{
test
:
/icons
\.
svg$/
,
loader
:
'
file-loader
'
,
options
:
{
name
:
'
[name].[hash:8].[ext]
'
,
},
},
{
test
:
/
\.
svg$/
,
exclude
:
/icons
\.
svg$/
,
loader
:
'
raw-loader
'
,
},
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment