Vue cli and vuetify how to use with local Roboto font












0















I have a Vue / Vuetify application under development created with the VUE CLI 3.x and would like to serve the Roboto font locally, not via Google cdn.



Has anyone accomplished this via webpack and the vue cli generated vuetify app project and if so how did you go about it?










share|improve this question























  • What prevents you from just installing a package and importing the font-face in App.vue? npmjs.com/package/roboto-fontface

    – Sumurai8
    Nov 23 '18 at 21:07











  • Actually, after revisiting this, probably that webpack does not automatically pick up the font files. This question may be useful to you: stackoverflow.com/questions/43348768/… It suggests literally copying over the font files you need to your assets folder and manually defining the font-faces you require.

    – Sumurai8
    Nov 23 '18 at 22:03
















0















I have a Vue / Vuetify application under development created with the VUE CLI 3.x and would like to serve the Roboto font locally, not via Google cdn.



Has anyone accomplished this via webpack and the vue cli generated vuetify app project and if so how did you go about it?










share|improve this question























  • What prevents you from just installing a package and importing the font-face in App.vue? npmjs.com/package/roboto-fontface

    – Sumurai8
    Nov 23 '18 at 21:07











  • Actually, after revisiting this, probably that webpack does not automatically pick up the font files. This question may be useful to you: stackoverflow.com/questions/43348768/… It suggests literally copying over the font files you need to your assets folder and manually defining the font-faces you require.

    – Sumurai8
    Nov 23 '18 at 22:03














0












0








0








I have a Vue / Vuetify application under development created with the VUE CLI 3.x and would like to serve the Roboto font locally, not via Google cdn.



Has anyone accomplished this via webpack and the vue cli generated vuetify app project and if so how did you go about it?










share|improve this question














I have a Vue / Vuetify application under development created with the VUE CLI 3.x and would like to serve the Roboto font locally, not via Google cdn.



Has anyone accomplished this via webpack and the vue cli generated vuetify app project and if so how did you go about it?







vue.js webpack vuetify.js roboto






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Nov 23 '18 at 20:26









JohnCJohnC

1,28532336




1,28532336













  • What prevents you from just installing a package and importing the font-face in App.vue? npmjs.com/package/roboto-fontface

    – Sumurai8
    Nov 23 '18 at 21:07











  • Actually, after revisiting this, probably that webpack does not automatically pick up the font files. This question may be useful to you: stackoverflow.com/questions/43348768/… It suggests literally copying over the font files you need to your assets folder and manually defining the font-faces you require.

    – Sumurai8
    Nov 23 '18 at 22:03



















  • What prevents you from just installing a package and importing the font-face in App.vue? npmjs.com/package/roboto-fontface

    – Sumurai8
    Nov 23 '18 at 21:07











  • Actually, after revisiting this, probably that webpack does not automatically pick up the font files. This question may be useful to you: stackoverflow.com/questions/43348768/… It suggests literally copying over the font files you need to your assets folder and manually defining the font-faces you require.

    – Sumurai8
    Nov 23 '18 at 22:03

















What prevents you from just installing a package and importing the font-face in App.vue? npmjs.com/package/roboto-fontface

– Sumurai8
Nov 23 '18 at 21:07





What prevents you from just installing a package and importing the font-face in App.vue? npmjs.com/package/roboto-fontface

– Sumurai8
Nov 23 '18 at 21:07













Actually, after revisiting this, probably that webpack does not automatically pick up the font files. This question may be useful to you: stackoverflow.com/questions/43348768/… It suggests literally copying over the font files you need to your assets folder and manually defining the font-faces you require.

– Sumurai8
Nov 23 '18 at 22:03





Actually, after revisiting this, probably that webpack does not automatically pick up the font files. This question may be useful to you: stackoverflow.com/questions/43348768/… It suggests literally copying over the font files you need to your assets folder and manually defining the font-faces you require.

– Sumurai8
Nov 23 '18 at 22:03












1 Answer
1






active

oldest

votes


















1














First install package typeface-roboto into your project.



Then import it into your main.js/index.js/boot.js or whatever:



import 'typeface-roboto/index.css';


Finally, update your webpack.config.js to allow the use of the font file types within the module rules i.e.:



    module: {
rules: [
//other stuff
{ test: /.(png|woff|woff2|eot|ttf|svg)$/, use: 'url-loader?limit=25000' }
]
},


The font file types are woff, woff2, eot and ttf.






share|improve this answer
























  • Thank you very much SnakeyHips this was perfect. Did not need to modify a webpack.config.js (doesn't exist in my Vue CLI project), worked with first two steps alone.

    – JohnC
    Nov 26 '18 at 22:38











Your Answer






StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");

StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














draft saved

draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53452593%2fvue-cli-and-vuetify-how-to-use-with-local-roboto-font%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown

























1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes









1














First install package typeface-roboto into your project.



Then import it into your main.js/index.js/boot.js or whatever:



import 'typeface-roboto/index.css';


Finally, update your webpack.config.js to allow the use of the font file types within the module rules i.e.:



    module: {
rules: [
//other stuff
{ test: /.(png|woff|woff2|eot|ttf|svg)$/, use: 'url-loader?limit=25000' }
]
},


The font file types are woff, woff2, eot and ttf.






share|improve this answer
























  • Thank you very much SnakeyHips this was perfect. Did not need to modify a webpack.config.js (doesn't exist in my Vue CLI project), worked with first two steps alone.

    – JohnC
    Nov 26 '18 at 22:38
















1














First install package typeface-roboto into your project.



Then import it into your main.js/index.js/boot.js or whatever:



import 'typeface-roboto/index.css';


Finally, update your webpack.config.js to allow the use of the font file types within the module rules i.e.:



    module: {
rules: [
//other stuff
{ test: /.(png|woff|woff2|eot|ttf|svg)$/, use: 'url-loader?limit=25000' }
]
},


The font file types are woff, woff2, eot and ttf.






share|improve this answer
























  • Thank you very much SnakeyHips this was perfect. Did not need to modify a webpack.config.js (doesn't exist in my Vue CLI project), worked with first two steps alone.

    – JohnC
    Nov 26 '18 at 22:38














1












1








1







First install package typeface-roboto into your project.



Then import it into your main.js/index.js/boot.js or whatever:



import 'typeface-roboto/index.css';


Finally, update your webpack.config.js to allow the use of the font file types within the module rules i.e.:



    module: {
rules: [
//other stuff
{ test: /.(png|woff|woff2|eot|ttf|svg)$/, use: 'url-loader?limit=25000' }
]
},


The font file types are woff, woff2, eot and ttf.






share|improve this answer













First install package typeface-roboto into your project.



Then import it into your main.js/index.js/boot.js or whatever:



import 'typeface-roboto/index.css';


Finally, update your webpack.config.js to allow the use of the font file types within the module rules i.e.:



    module: {
rules: [
//other stuff
{ test: /.(png|woff|woff2|eot|ttf|svg)$/, use: 'url-loader?limit=25000' }
]
},


The font file types are woff, woff2, eot and ttf.







share|improve this answer












share|improve this answer



share|improve this answer










answered Nov 26 '18 at 13:42









SnakeyHipsSnakeyHips

609113




609113













  • Thank you very much SnakeyHips this was perfect. Did not need to modify a webpack.config.js (doesn't exist in my Vue CLI project), worked with first two steps alone.

    – JohnC
    Nov 26 '18 at 22:38



















  • Thank you very much SnakeyHips this was perfect. Did not need to modify a webpack.config.js (doesn't exist in my Vue CLI project), worked with first two steps alone.

    – JohnC
    Nov 26 '18 at 22:38

















Thank you very much SnakeyHips this was perfect. Did not need to modify a webpack.config.js (doesn't exist in my Vue CLI project), worked with first two steps alone.

– JohnC
Nov 26 '18 at 22:38





Thank you very much SnakeyHips this was perfect. Did not need to modify a webpack.config.js (doesn't exist in my Vue CLI project), worked with first two steps alone.

– JohnC
Nov 26 '18 at 22:38




















draft saved

draft discarded




















































Thanks for contributing an answer to Stack Overflow!


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53452593%2fvue-cli-and-vuetify-how-to-use-with-local-roboto-font%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

Wiesbaden

Marschland

Dieringhausen