Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The compatible path on windows system. #12

Open
zhazhaxia opened this issue Feb 27, 2020 · 1 comment
Open

The compatible path on windows system. #12

zhazhaxia opened this issue Feb 27, 2020 · 1 comment

Comments

@zhazhaxia
Copy link

zhazhaxia commented Feb 27, 2020

image

Originally posted by @liximomo in #10 (comment)


Webpack use eval to exceute your template code.
So the result maybe for the following code.

const p = path.win32.join('e:','a.js'); // e:\\a.js
const template = `var api = '${p}'`; // var api = \'e\\a.js\'

// use eval excute template on browser

eval(template);

console.log(api) // e:a.js

This exception caught on browser because of the eval function that webpack use.

@zhazhaxia zhazhaxia changed the title ![image](https://user-images.githubusercontent.com/9816225/75414496-b4500980-5963-11ea-899e-067d7ec831d6.png) The compatible path on windows system. Feb 27, 2020
@liximomo
Copy link
Owner

liximomo commented Feb 27, 2020

Sorry for missing that, I will reopen the PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants