Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Referencing resources in node_modules folder

I am currently in the process of writing my first Node.js app. I recently installed bootstrap via the npm (following instructions on bootstrap's web site) and was wondering the "standard" way of referencing the bootstap.min.css (and other files of interest). It is best to use grunt/gulp to copy (bundle and minify) the resources I need into my project structure?

Any help would be appreciated.

like image 797
miniscem Avatar asked Dec 09 '25 00:12

miniscem


1 Answers

I was able to copy with the node_modules bootstrap resources with a simple Grunt task:

copy: {
    bootstrapSrcCss: {
      src: "./node_modules/bootstrap/dist/css/bootstrap.css",
      dest: "./public/src/css/bootstrap.css"
    },
    bootstrapSrcJs: {
      src: "./node_modules/bootstrap/dist/js/bootstrap.js",
      dest: "./public/src/js/bootstrap.js"
    }
}

Using grunt plug-in: grunt-contrib-copy

like image 158
miniscem Avatar answered Dec 10 '25 17:12

miniscem



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!