ZPPP
ZPPP

Reputation: 1578

Include css from node_module(npm package)?

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

Upvotes: 2

Views: 1989

Answers (1)

N3dst4
N3dst4

Reputation: 6435

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));
});

Upvotes: 4

Related Questions