In the path of the electron-vue problem in Windows, path.resolve replaced path.posix.join.

The reason is very simple, as the following code problem occurs in the Windows electron-vue, do not ask me why, I am also very confused, following the relevant code.

      return path.resolve(this.basePath, routePath)
      // return path.join(this.basePath, routePath)
      // return path.posix.join(this.basePath, routePath)

return path.resolve (this.basePath, routePath) in the presence of:

return path.join (this.basePath, routePath) in the presence of:

It looks like there is no problem? But in fact this is the expansion path.

Obviously, Windows path is adjusted to slash a path, also known as the backslash.

The last adjusted return path.posix.join (this.basePath, routePath)

That is posix-style path, as shown below.

At this point normal, Bibi heart.

Cross-platform still have to look posix api.

Guess you like

Origin www.cnblogs.com/juwan/p/12289623.html