how to import libraries from cdn in reactjs?

前端 未结 3 1950
难免孤独
难免孤独 2020-12-28 14:22

I have tried:

import \'maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css\';

but it produces error. How can i import a cdn in my

3条回答
  •  盖世英雄少女心
    2020-12-28 14:36

    You don't bundle CDN stuff inside your JS, that sort of defeats the purpose of having it on CDN :). Had this been JS, I would have asked you to use externals, but for a CSS, you can use https://github.com/jso0/html-webpack-cdn-plugin instead.

提交回复
热议问题