包括来自 node_module(npm 包)的 css?
Posted
技术标签:
【中文标题】包括来自 node_module(npm 包)的 css?【英文标题】:Include css from node_module(npm package)? 【发布时间】:2016-04-13 07:05:07 【问题描述】:我在客户端使用 React,我需要从 npm 包中包含 css。 在我把它们复制到我的本地目录之前。
我也在工作草案中使用 GULP
【问题讨论】:
【参考方案1】:作为构建的一部分,您可以使用 gulp 从 node_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));
);
【讨论】:
以上是关于包括来自 node_module(npm 包)的 css?的主要内容,如果未能解决你的问题,请参考以下文章