在Gulp中使用命名约定时出错

编程入门 行业动态 更新时间:2024-10-25 08:22:33
本文介绍了在Gulp中使用命名约定时出错的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我正在使用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 - 在它前面。它不需要(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中使用命名约定时出错

本文发布于:2023-10-23 06:07:37,感谢您对本站的认可!
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:Gulp

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!