简体   繁体   English

gulpfile.js中定义的路径

[英]path defining in gulpfile.js

I have my project based folder as follows. 我有基于项目的文件夹,如下所示。

root_Folder
    |______project_folder1
    |         |___dist
    |         |    |____js
    |         |          |___app.js(converted)
    |         |___src
    |         |    |____js
    |         |          |___app.js
    |         |___index.html
    |______project_folder2
    |         |___dist
    |         |    |____js
    |         |          |___app.js(converted)
    |         |___src
    |         |    |____js
    |         |           |___app.js
    |         |___index.html  
    |______project_folder3,4,etc.
    |_____gulpfile.js

here I have a root folder. 在这里,我有一个根文件夹。 under the root folder I have project folder with es6 and they will we converted and converted file will be saved in dist folder. 在根文件夹下,我有带有es6的项目文件夹,我们将它们转换,转换后的文件将保存在dist文件夹中。

project folder will be created dynamically. 项目文件夹将动态创建。 since there will be new project folders I cannot mention a correct path in between root folder and the src folder of each project. 因为会有新的项目文件夹,所以我无法在每个项目的根文件夹和src文件夹之间提到正确的路径。 how can I define a path. 如何定义路径。 I want to find the changes of JavaScript files in src folder in each project. 我想在每个项目的src文件夹中找到JavaScript文件的更改。 not the dist folder.. 不是dist文件夹。

I cannot use './rootFolder/**/*' since this will detect all the Javascript files inside the project including the dist folder. 我不能使用'./rootFolder/**/*'因为这将检测项目中的所有Javascript文件,包括dist文件夹。

need help thank you. 需要帮助谢谢。

你可以简单地做'./rootFolder/**/src/**/*.js'有一个讨论在这里

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM