improve bundle size by only including required icons
This commit is contained in:
parent
367e494873
commit
d686f51dff
1 changed files with 4 additions and 1 deletions
|
@ -12,6 +12,9 @@
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
const requireIcon = require.context("simple-icons/icons/", false, /(instagram|github|twitter|keybase)\.js/);
|
||||||
|
|
||||||
|
console.log(requireIcon.keys());
|
||||||
export default {
|
export default {
|
||||||
name: "SocialIcon",
|
name: "SocialIcon",
|
||||||
props: {
|
props: {
|
||||||
|
@ -25,7 +28,7 @@
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
simpleIcon: require(`simple-icons/icons/${this.icon}`)
|
simpleIcon: requireIcon(`./${this.icon}.js`)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue