问题
I've developed a small package that I'm serving from a github repo. It's basically a UI Library and it has only a SCSS file.
my-ui-library
-- src/styles.scss
I would like that after the installation the package run itself a gulp task that compiles the CSS, and move it to other location.
The desired output, after the gulp task is run, is something like this:
my-ui-library
-- src/styles.scss
-- styles.scss
I've included some scripts
"scripts": {
"postinstall": "gulp"
}
I can´t find the way to run gulp after the install of the package.
Any help will be appreciated.
回答1:
In your postinstall
script you can use the --gulpfile flag for gulp
to specify where your other gulp file to use is.
"scripts": {
"postinstall": "gulp --gulpfile <path-to-gulpfile>"
}
来源:https://stackoverflow.com/questions/37353703/run-gulp-task-after-npm-package-install