-
Notifications
You must be signed in to change notification settings - Fork 19
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
Cannot use within webpack #20
Comments
FWIW, seems there is a shebang-loader that will solve this problem for me within webpack. So the fact that I don't need to write my own loader/code (and others have encountered it with a few different npm modules out there), makes this feel like less of a datauri issue. But I know there are numerous webpack issues about this, where they keep claiming it's the problem of the module authors, who are making libraries-that-are-also-scripts. (Since technically, # is technically not a valid javascript comment, and these are malformed JS files to include/require in a build setting.) |
@mikelambert I'm in the same position you are, trying to get Update for anyone else in my shoes: This |
Ah sorry for the delay in responding, just came to respond and saw you figured it out. Just a heads-up, I was unable to get Finally just gave up and am currently inlining my CSS in the tags where it's necessary (mainly to override link colors, which didn't work with a <style> tag due to some sort of precedence issues.) |
I'm sorry guys, I was very busy with work this year. Gonna check |
@john-osullivan @mikelambert How exactly did you resolve it?
and
I've included these in my |
What is the status of this issue? It's more that one year old! |
Not true. |
Just a recall that PRs are always welcomed in open-source community and behind the scenes we have humans writing codes. Apparently, shamming contributors sounds an easier path though 😄 But yes! I should have prioritized it somehow, and sorry for those waiting for. Being very transparent, I totally forget about this issue(can I?) and sometime I'll fix/review it. Cheers! 🍵 |
v2.0 FINALLY released https://github.com/data-uri/datauri/releases/tag/v2.0.0 Could any of you please recheck if it fixes webpack compatibility? |
I just checked. I can confirm that it works. Thank you. |
Thank you all for reporting this and sorry for my absence last year. 🍵 |
I'm using webpack to compile some serverside javascript. One of these files builds an
mjml
server that transitively depends ondatauri
. Webpack gives me the following error:I can fix this in my webpack config, by writing a custom loader that takes the file and then deletes any beginning-#-lines. But note that of all the npm modules I'm using, this is the only one. I'll probably end up doing this to clean up this webpack error, and avoid blocking on this Issue.
From what I've seen in other threads, it's considered "bad practice" (according to The Internetz) to have a file act as both a script as well as a library module, for this reason.
I'm filing a bug, to track fixing this, or to close out my Issue as Working As Intended/Will Not Fix. :)
The text was updated successfully, but these errors were encountered: