Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Including from a CDN #3671

Closed
cool88 opened this issue Jan 2, 2018 · 3 comments
Closed

Including from a CDN #3671

cool88 opened this issue Jan 2, 2018 · 3 comments

Comments

@cool88
Copy link

cool88 commented Jan 2, 2018

I want to include the bootstrap (or let's say ion-icons) from the CDN to divert the bandwidth from my own server instead of including it using a node_module. I know I can edit the public/index.html. But is it advisable? That's I guess my real question. I mean would there be the intended benefit of doing so?

@gaearon
Copy link
Contributor

gaearon commented Jan 2, 2018

Sure, sounds fine.

@gaearon gaearon closed this as completed Jan 2, 2018
@bondz
Copy link
Contributor

bondz commented Jan 6, 2018

I use semantic-ui in one of my projects and in development, I'd like to be able to work offline but serve the CSS from a CDN in production.

In my index.html file, I have

  <% if (process.env.NODE_ENV !== 'development') { %>
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/semantic-ui/2.2.13/semantic.min.css" integrity="sha384-370KB8zqOlHxys9dcOyC7aCeXVtGyiKkWkp+cn8Mfoi13/sPj7fvSuhKRRdFbcip"
      crossorigin="anonymous">
    <% } %>

and in index.js

if (process.env.NODE_ENV === 'development') {
  import('semantic-ui-css/semantic.min.css');
}

I imagine you can do the same for bootstrap.

@mammosu
Copy link

mammosu commented May 14, 2018

I just added

@import 'https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css';

to index.css .

@lock lock bot locked and limited conversation to collaborators Jan 19, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants