在 JavaScript MVC 中的构建过程中找不到生产.css

Cannot find production.css during the build process in JavaScript MVC

本文关键字:找不到 css 过程中 构建 JavaScript MVC      更新时间:2023-09-26

我生成了一个示例应用程序,只是为了测试构建过程,它在构建过程中出错。

$ ./js steal/buildjs apps/hello/hello.html -to apps/helloprod
Building to apps/helloprod/
BUILDING STYLES --------------- 
   apps/hello/hello.css
STYLE BUNDLE > apps/helloprod/production.css
Nice! Compressed: 17.1%  Before: 41.0 bytes  After: 34.0 bytes
!!!!!!!!!!! ERROR !!!!!!!!!!!
-message       = java.io.FileNotFoundException: apps/helloprod/production.css (No such file or directory)
-fileName      = steal/rhino/file.js
-lineNumber    = 217
-name          = JavaException
-javaException = java.io.FileNotFoundException: apps/helloprod/production.css (No such file or directory)
                 error loading html element  [object HTMLScriptElement]   JavaException: java.io.FileNotFoundException: apps/helloprod/production.css (No such file or directory) 

当我生成一个应用程序时,默认情况下.css文件中有一些内容,所以我什至尝试删除里面的内容(在这种情况下,它会出错,因为它无法计算文件大小,例如它说NaN undefined而不是 41.0 字节)。当我刚刚在hello.css遇到这个时,出现了这个特殊的错误:

body{
  background-color:lightyellow;
}

有什么想法吗?

根据错误消息,您的问题是apps/helloprod/production.css文件丢失。

请确保此文件存在,如果从生成过程中删除。

编辑:

是因为steal/rhino/file.js作为 CSS 的源文件包含在内吗?