我正在使用Zurb Foundation框架开展这个项目,并在Gulp上运行。基本上Gulp所做的就是将sass转换为css,compress,concatenate等等。它运行完美,它做它应该做的事情,直到我尝试更改 dist 文件夹,其中一切都是为生产而构建的。我想要使用的名称是 name-html5 。 -html5 是 3dCart 的命名约定,因此它需要 -html5 中的文件夹的名称。在 gulpfile.babel.js 我有:
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); }如果我将 dist $ c $我得到了一个构建错误: ReferenceError:html5没有被定义,因为<$ c name-html5 $ c> - 在它前面。它不需要(PATHS.name-html5,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).
另外,我更改了名称在 config.yml 文件中:
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?
推荐答案不是有一个 name-html5 属性名称,试着拿出连字符。它可以保留在值中。
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"然后引用它作为 PATHS.nameHtml5
更多推荐
在Gulp中使用命名约定时出错
发布评论