繁体   English   中英

包括来自node_module(npm包)的CSS?

[英]Include css from node_module(npm package)?

我在客户端上使用React,我需要从npm包中包含CSS。 在我拿走它们并复制到我本地的导演风格之前。

我也在工作草案中使用GULP

您可以在构建过程中使用node_modulesnode_modules复制文件:

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

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM