Production output contains Function constructor
See original GitHub issueDescribe the bug
After running yarn build
, the generated files still contain the Function()
constructor. Upon trying to upload an extension to the Firefox store, the linter states The Function constructor is eval.
in both content-script.js
and background.js
. I have kept the OOTB vue.config.js
and babel.config.js
.
To Reproduce Steps to reproduce the behavior:
- Fix
background.js
to point tojs/content-script.js
- Run
yarn build
Expected behavior
The output files to be free of eval()
and Function()
to comply with Mozilla’s CSP.
Desktop (please complete the following information):
- vue-web-extension version: 2.0.0
- OS: Windows 10 Pro - 19042.746
- Node.js version: 14.15.4
Issue Analytics
- State:
- Created 3 years ago
- Comments:10 (4 by maintainers)
Top Results From Across the Web
Function() constructor - JavaScript - MDN Web Docs
The Function() constructor creates a new Function object. Calling the constructor directly can create functions dynamically, ...
Read more >Constructor Function - an overview | ScienceDirect Topics
The file contains three functions: operator constructors, operator destructors, and functions called by the operator host. The operator constructor function ...
Read more >Constructor in C++ and Types of Constructors - Great Learning
Constructors are class functions that are called when new instances of the class's objects are produced. The constructors share the same name as ......
Read more >Calling virtual functions inside constructors - Stack Overflow
A constructor must either contain an explicit call to its parent's constructor (which does not have to be the first action - it...
Read more >Constructor in Java | DigitalOcean
Default constructor only role is to initialize the object and return it to the calling code. Default constructor is always without argument and ......
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I appreciate the analysis! I’ll see what I can do, thanks!
What about:
from https://github.com/Kocal/vue-web-extension/issues/658#issuecomment-767101336?