问题标签 [grunt-contrib-sass]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票
3 回答
818 浏览

javascript - grunt + sass:同时输出2个css文件

我想让 grunt 编译我的 sass 的紧凑和压缩版本。我可以让它编译一个或另一个,但不能同时编译。我试过了:

并且:

但两者都没有奏效。解决方案是什么?

0 投票
1 回答
508 浏览

javascript - “path.join 的参数必须是字符串”问题

我正在尝试使用 grunt sass 编译我的 css 文件,这里是 Gruntfile.js

但是,当我使用“grunt”命令查看并更改 sass/ 目录中的任何 sass 文件时,它总是返回以下错误。

有什么办法可以解决吗?已经是串了

0 投票
1 回答
79 浏览

sass - 使用 Grunt.js 动态观察并随后将 SASS 文件目录编译成一个 CSS 文件

我是 Grunt.js 的新手,但我开始掌握它的窍门。然而,我想用它做的主要事情,我似乎无法确定。

我的目标是将 grunt 指向一个目录,让它监视所有匹配的文件,并在更改后将它们编译成一个新的单个 CSS 文件。

这是我当前的 gruntfile:

到目前为止,我一直在使用 grunt-contrib-watch 和 grunt-contrib-sass。我已经尝试过指南针以及目录导入,但我无法让他们中的任何一个做我想做的事情。

归根结底,我真的只是想避免编写导入文件,因为源顺序对于我编写 SASS 的方式并不重要,因为我真的很想知道如何实现这一目标。

0 投票
1 回答
182 浏览

ruby - Grunt-contrib-sass or the sass gem is not working when using git push

I'm pretty sure I've tracked the issue down to Node.js not seeing Sass, but I have no clue why...

If I push from my laptop using: git push lamp somebranch:master, the server remotely checks it out fine, runs npm install without error, and starts processing the gruntfile, but then aborts with "remote: Warning: spawn ENOENT Use --force to continue."

However, (after I push from my laptop like above) I can ssh in, cd into my hooks directory and run ./post-receive and it finishes "Done, without errors." I also tried running grunt in the website's root and it also completed without error.

Any ideas as to what might be going on? I'm completely stumped. Should I set paths to the sass gem in the hook? I scrapped down my gruntfile to use the same target locally as well as on the server to rule out the gruntfile. It compiles fine locally, compiles fine on the server, but fails only when using git push lamp somebranch:master.

0 投票
1 回答
399 浏览

gruntjs - 运行 grunt 并将 sass 编译到与源文件相同的目录

我的所有 scss 都在父文件夹下,并且正在运行一个 grunt 任务来编译它们。

对于这个特定的项目,不会有构建或输出文件夹。我想让所有的 scss 文件在它们的同一个目录中编译。

+ folder + component - style.scss - style.css + another - style.scss - style.css

我搜索了高低,找不到任何这样的例子。Grunt甚至可以吗?

0 投票
1 回答
45 浏览

gruntjs - 为什么 grunt-sass 比单独使用 sass 慢?

我单独使用了 sass(不使用 grunt)和彻底的 grunt。我观察到 grunt-sass 比单独使用 sass 慢得多。这可能是什么原因?我通过以下代码禁用了 grunt-sass 中的 sourceMap:

0 投票
2 回答
277 浏览

sass - 我如何在 grunt-contrib-sass 中编写一些任务?

我的 gruntfile.js 中有这样的内容:

但这只是一项任务。如何组合两个或多个任务?正如我在一些 grunt 模块中所知道的,您可以像这样组合多个任务:

但这不起作用,GruntJs 没有显示错误,也没有编译 sass。这有什么问题?

0 投票
1 回答
209 浏览

sass - 如何让 Grunt 重新编译依赖的 SASS 文件?

我正在尝试完成对 Visual Studio 2015 的更新,包括使用 Grunt 等。

当文件发生变化时,我可以让 Grunt 重新编译.scss文件,但我遇到了问题。我使用 SASS 进行主题化,我的很多 CSS 都在一个中心_main.scss. 我想要的是当我编辑该文件时,它应该重新编译所有theme-*.scss包含_main.scss.

当依赖关系发生变化时,有没有办法告诉watch或类似的东西来重新编译东西?即使我必须手动指定依赖项?

0 投票
1 回答
266 浏览

gruntjs - Grunt:文件更改后将 sass 转换为 css(观看)

所以这是我的 gruntfile.js:

我的问题:当我启动 grunt 时,它会检查我的 sass 文件并自动将其转换为 css 文件。查看。但是如果我开始 grunt 然后编辑一个 sass 文件,它会识别更改但不会再次将 sass 转换为 css。有人看到错误吗?

干杯!

0 投票
1 回答
534 浏览

javascript - 由于 bourbon 包而产生错误的 grunt sass 任务

我正在为我的项目编写一个 grunt 任务文件。我已经sass在其中定义了任务并安装了所有必需的依赖项。我可以在我朋友的计算机上运行相同的 gruntfile,但在我的计算机上,sass 任务会产生此错误。

由于这个错误,我无法执行 sass 任务,需要在我朋友的计算机上执行。我还添加了我的 Gruntfile.js,以便更好地了解我的 grunt 任务是什么以及它是如何工作的,请看一下。

如果有人在此之前解决了这个问题,请告诉我。