Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

143
Views
If a Vue.js project uses Single File Components, does it mean vue libraries cannot be loaded from CDN?

I downloaded a tutorial from https://github.com/Ethiel97/simple-chart-vue It seems to be built with vue-cli

I would like to convert it to load Vue over CDN. I do not know where to insert code to load the Vue libraries from CDN because there is no HTML code due to use of Single File Components .vue files.

Where to insert following code?

<script src="https://cdnjs.cloudflare.com/ajax/libs/Chart.js/2.7.1/Chart.min.js"></script>
<script src="https://unpkg.com/vue-chartjs/dist/vue-chartjs.min.js"></script>

Am I right that if Vue code uses SFC (single file component), it cannot load js library through CDN?

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

It doesn't matter that you are using single-file components. In production, you need to use a module bundler such as Webpack to compile your application to a single app.js and app.css. By doing that, you'll be able to attach the JS and CSS file in your HTML code and it would be compatible with CDNs.

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!