我正在尝试捆绑特定文件夹中的所有.js文件,但收到':没有这样的文件或目录‘错误。
下面是我的代码:
const ClosureCompiler = require('google-closure-compiler').jsCompiler;
const { writeFile } = require('fs');
const closureCompiler = new ClosureCompiler({
js: 'c:/polyfill/**.js',
js_output_file: 'bundle.js'
});
const compilerProcess = closureCompiler.run([{
path: './',
}], (exitCode, stdOut, stdErr) => {
writeFile(stdOut[0].path, stdOut[0].src,()=>{});
});
发布于 2019-06-10 18:01:01
看起来这个路径js: 'c:/di/webapp/public/js/polyfill/**.js',是wrong.If,它是windows,通常在c:/之后,你会得到Users目录。
您可以转到文件位置,然后右键单击该位置以获取“属性”。复制Location值并将反斜杠替换为正斜杠
https://stackoverflow.com/questions/56524044
复制相似问题