-
-
Notifications
You must be signed in to change notification settings - Fork 168
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
What could be right way to dynamically import a file from a npm package into a webpage through content_script? #44
Comments
Could you kindly add a reproducible repo for me to test the above? |
Sure. Give me a few minutes. And Thanks! |
Try with |
Tried both. Please find the code here |
ahhh... Is there an alternate way of doing this. I just need to inject script occasionally on an action. |
@abhinavzspace I had luck with this but it doesn't use dynamic imports. I will look into this issue anyways. My guess with with babel plugins. |
Thanks! Will look into it. |
Confirmed. Alternate way you suggested, works. Thanks a lot. |
Cool. The way with dynamic import should've worked, but at this point I am unclear about why it doesn't work. Closing this issue for now. Feel free to reopen if you run into problems again. Thanks |
I have been unsuccessful in trying to import a file from npm package into a web page through content_script. I want to import this file on an action from popup browser action.
To establish the basic setup, I tried importing your
emoji-log
library. I followed the following steps:new CopyWebpackPlugin([{from: 'node_modules/emoji-log/lib/index.js', to: 'js/emoji-log/lib/index.js'}]),
in webpack.config.jsI get the following error:
And strangely when I click on the filename, it opens up in the new tab straight away.
What am I missing here? I am stuck on this from quite a few hours.
(These instructions are mostly from here and here)
The text was updated successfully, but these errors were encountered: