Error when using naming convention in Gulp

拥有回忆 提交于 2019-12-11 17:23:19

问题


I am working on this project using Zurb Foundation framework and it runs on Gulp. Basically what Gulp does is turn sass into css, compress, concatenate, etc. It runs perfect and it does what it’s suppose to do, UNTIL I try to change the name of the dist folder, where everything is built for production. The name I want to use is name-html5. The -html5 is a naming convention of 3dCart, so it needs the -html5 in the name of the folder. In gulpfile.babel.js I have:

// Delete the "dist" folder
// This happens every time a build starts
function clean(done) {
  rimraf(PATHS.dist, done);
}

If I substitute the dist for name-html5 I get a build error: ReferenceError: html5 is not defined because of the - in front of it. It just won’t take (PATHS.name-html5, done).

Also, I changed the name in config.yml file:

# Gulp will reference these paths when it copies files
PATHS:
  # Path to dist folder
  dist: "dist"  

but it didn't fix the issue. Any help?


回答1:


Instead of having a name-html5 property name, try taking out the hyphen. It can stay in the value.

# Gulp will reference these paths when it copies files
PATHS:
  # Path to dist folder
  dist: "dist"
  nameHtml5: "name-html5"

Then reference it as PATHS.nameHtml5



来源:https://stackoverflow.com/questions/50279551/error-when-using-naming-convention-in-gulp

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!