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

Doesn't inline JavaScript with type="module" #225

Open
ashleydavis opened this issue Feb 5, 2022 · 3 comments
Open

Doesn't inline JavaScript with type="module" #225

ashleydavis opened this issue Feb 5, 2022 · 3 comments

Comments

@ashleydavis
Copy link

Not sure if this is a bug or intended operation, but Inline appears to ignore script tags with type="module", for example:

<script type="module" src="src.df4b993c.js"></script>

The output in the inlined file is lets the script tag pass through verbatim.

If I remove the type="module" then the JavaScript code is inlined correctly.

@fsicre
Copy link

fsicre commented Mar 30, 2022

Try this change

file js.js
line 18

    if (type && type.toLowerCase() !== 'text/javascript') {
      debug('skipping %s', type);
      return false;
    }

PR #226

@ashleydavis
Copy link
Author

ashleydavis commented Apr 10, 2022

@fsicre that works when I hack it into my local version of inliner.

Thanks, hope you PR gets accepted soon!

@enk-it
Copy link

enk-it commented Aug 9, 2024

Can confirm!

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

3 participants