Ad

Include Css From Node_module(npm Package)?

- 1 answer

I use React on client, and i need include css from npm package. Before I took them and copied to my local directorie with style.

I also use GULP in the working draft

Ad

Answer

You can use gulp to copy files from node_modules as part of your build:

var srcPath = "node_modules/whatever/stylesheets/*.css";
var buildPath = "folder/that/gets/served/to/client";
gulp.task("build-html", function () {
    return gulp.src(srcPath).pipe(gulp.dest(buildPath));
});
Ad
source: stackoverflow.com
Ad