在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称(OpenSource Name):gunpowderlabs/gulp-environments开源软件地址(OpenSource Url):https://github.com/gunpowderlabs/gulp-environments开源编程语言(OpenSource Language):JavaScript 100.0%开源软件介绍(OpenSource Introduction):gulp-environmentsA Gulp plug-in that makes it convenient to create separate environments, such as development and production, to run your tasks in. Basic usageInstall the plugin using npm:
Require the plug-in somewhere in your
By default, the library defines two environments: development and production. For convenience sake, it is recommended to assign them to local variables:
You can use these environments as predicates (functions returning true/false depending on whether the given environment is active):
You can also use the environment as a filter in you Gulp pipelines:
Setting the environmentBy default, gulp-environments uses the NODE_ENV environment variable to determine environment:
You can also pass a command line flag --env to set it (takes precedence over NODE_ENV):
Alternatively, you can define a task that would set the appropriate environment before executing other tasks:
and run it (or make it a dependency of a task that should also be run in that environment):
Finally, you can always set the environment by hand in your task definition:
Other environmentsYou don't have to limit yourself to using only the two provided environments. You can create other ones by calling (in the example, we are creating an environment called staging):
LicenseMIT AuthorAdam Pohorecki |
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论