我有一个与 Liferay 7(基于 Ant)兼容的主题。我尝试优化 Liferay Portal CE 7.0 的插件。
我将主题从插件 sdk迁移到Liferay 主题生成器,当我运行 gulp build 时出现以下错误:
C:\Users\User1\liferay-workspace\themes\new-theme\node_modules\liferay-theme-tasks\tasks\build.js:347
throw err;
^
Error: build\_css\main.scss
Error: It's not clear which file to import for '@import "custom"'.
Candidates:
_custom.scss
custom.css
Please delete or rename all but one of these files.
on line 19 of build/_css/main.scss
>> @import "custom";
^
at options.error (C:\Users\User1\liferay-workspace\themes\new-theme\node_modules\node-sass\lib\index.js:286:26)
:themes:new-theme:gulpBuild FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':themes:new-theme:gulpBuild'.
> Process 'command 'cmd'' finished with non-zero exit value 1
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
BUILD FAILED
总结来自评论的答案:
似乎您创建了两个文件,通常您的代码需要使用 _x 版本,scss 将使用它来构建具有导入内容的文件;这意味着这些文件并不是要作为一个整体使用,而是要成为另一个的一部分。
尝试删除没有下划线前缀的那个。Ps:确保你有一个副本。
您的过程可能混淆了一些东西。从自定义文件中获取内容并将其放在_custom上。这应该在 src 目录下。在您的构建文件夹中,您将看到 scss 和 css,通常只是主要的,但这取决于您的主题。您的主要 scss 显然包含该部分,因为它是定期完成的,这是使您的代码可用的部分。
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句