【发布时间】:2016-04-13 07:05:07
【问题描述】:
我在客户端使用 React,我需要从 npm 包中包含 css。 在我把它们复制到我的本地目录之前。
我也在工作草案中使用 GULP
【问题讨论】:
标签: node.js reactjs npm gulp node-modules
我在客户端使用 React,我需要从 npm 包中包含 css。 在我把它们复制到我的本地目录之前。
我也在工作草案中使用 GULP
【问题讨论】:
标签: node.js reactjs npm gulp node-modules
作为构建的一部分,您可以使用 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));
});
【讨论】: