2016-05-20 97 views
1

我开发了一个小包,我从github回购服务。它基本上是一个UI库,它只有一个SCSS文件。NPM软件包安装后运行gulp任务

my-ui-library 
-- src/styles.scss 

我想在安装后,程序包自己运行一个编译CSS的gulp任务,并将其移动到其他位置。

所需的输出,在运行任务一饮而尽后,是这样的:

my-ui-library 
-- src/styles.scss 
-- styles.scss 

我已经包含了一些脚本

"scripts": { 
    "postinstall": "gulp" 
} 

我不能找到运行一饮而尽的方式包装后安装。

任何帮助将不胜感激。

+0

我想你只需要指定你想在postinstall脚本中运行的gulp任务。 – forrert

+0

包装本身不可能具有特定的大文件? – Guillermo

+0

这应该工作。在postinstall脚本中调用“gulp”会告诉gulp执行在gulpfile中定义的默认任务。您从当前设置中看到的错误是什么? – forrert

回答

1

在您的postinstall脚本中,您可以使用--gulpfile flag作为gulp来指定您要使用的另一个gulp文件的位置。

"scripts": { 
    "postinstall": "gulp --gulpfile <path-to-gulpfile>" 
}