我正在尝试将所有.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,()=>{});
});
答案 0 :(得分:0)
此路径js: 'c:/di/webapp/public/js/polyfill/**.js',
似乎是错误的。如果是Windows,则通常在c:/
之后,您将获得Users
目录。
您可以转到文件位置,然后右键单击该文件以获取“属性”。复制Location
值,并用正斜杠代替反斜杠