homerchen19 / github-file-icons

🌈 🗂 A browser extension which gives different filetypes different icons to GitHub, GitLab, gitea and gogs.
https://chrome.google.com/webstore/detail/file-icon-for-github-and/ficfmibkjjnpogdcfhfokmihanoldbfe
MIT License
1.43k stars 68 forks source link

Remove ton of `eval` from build when `NODE_ENV` is `development` #20

Closed gluons closed 6 years ago

gluons commented 6 years ago

(Probably) Fix #19.

I use cross-env to set NODE_ENV to production when you build.

It will remove ton of eval from webpack's cheap-module-eval-source-map devtool (from below lines) when your computer sets NODE_ENV to development. 🤓

https://github.com/xxhomey19/github-file-icon/blob/c31db79dac4f550ecb0db5bcf5ad52950010b14f/webpack.config.js#L96-L98


However, it still has 1 eval in contentscript.bundle.js.

g = g || Function("return this")() || (1,eval)("this");

We probably need webpack/webpack#5627 to be resolved, I guess. 🤔

homerchen19 commented 6 years ago

Hi @gluons Thank you for the PR which helps a lot. I create another PR for the issue. Would you mind I close this PR and merge that one?

gluons commented 6 years ago

OK. Let's do it. 🙂

homerchen19 commented 6 years ago

Thank you!