简体   繁体   English

grunt.file.read用+ 10k字符替换文件中的内容为…(长度:xxxxx)

[英]grunt.file.read replacing content to …(length: xxxxx) in files with +10k chars

In my gruntfile, i'm using this code line to read a file, and assign his content to a variable: 在我的gruntfile中,我正在使用以下代码行读取文件,并将其内容分配给变量:

var content = grunt.file.read(file);

The file reading action it's ok, but if the file is large, like +10K chars, it's shows the first +-10k of chars and replace the rest for something like that: 可以读取文件,但是如果文件很大,例如+ 10K个字符,则显示前+ -10k个字符,并将其余的替换为类似的内容:

[*Something around the first 10k char appears here (OK) and then ...*] ...(length: 62967)

i searched through the entire web, but i'm not sure if is the grunt that is doing this, or the iconv-lite used by grunt to decode the file 我搜索了整个网络,但不确定是执行此操作的是grunt还是grunt用于解码文件的iconv-lite

The error above occurs just when inspecting via web developer tools. 仅当通过Web开发人员工具进行检查时,才会发生上述错误。 Maybe the browser has a limitation to show the entire content (when it's bigger) of a variable. 也许浏览器有一个局限性,无法显示一个变量的全部内容(当更大时)。

using the console.log() , i can see the entire content. 使用console.log() ,我可以看到全部内容。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM