Open cladder opened 6 years ago
Well, I found the problem...
in file dev-env/manifest/processor/lib/script.js
line 37
const injectorScript = makeInjector(scriptName);
const injectorFilepath = path.join(buildPath, scriptName);
const injectorPath = Remove.file(injectorFilepath)
// problem goes here,injectorPath => ''???
mkdirp.sync(injectorPath)
// if I change to mkdirp.sync(path.dirname(injectorFilepath)) then it works.
fs.writeFileSync(injectorFilepath, injectorScript, {encoding: 'utf8'})
log.done()
应该是Remove.file的问题
var injectorFilePath = 'E:\web\extensions\qwt\build\popup\index.js';
Remove.file(injectorFilepath); // ''
在win上路径会是\
而不是/
,这就是为什么会出问题了。dev-env/remove.js
export function file(filepath) {
// not works on win32 because the path seperator is '\' but not '/'
return filepath.split("/").slice(0,-1).join("/")
}
why not use path.dirname
? in file dev-env/remove.js
I change it to
import path from 'path';
...
export const file = path.dirname;
and it works on my win10 laptop.
Env: Win10 Err Message:
how to solve this problem??