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

Is there a way to set the script tag type to 'text/javascript'. #1780

Closed
mohanramegowda opened this issue Feb 7, 2023 · 2 comments
Closed

Comments

@mohanramegowda
Copy link

Prerequisites

  • We realize there is a lot of data requested here. We ask only that you do your best to provide as much information as possible so we can better help you.
  • Support questions are better asked in one of the following locations:
  • Ensure the issue isn't already reported.
  • Should be reproducible with the latest version of html-webpack-plugin.
    • (Ensure npm ls html-webpack-plugin matches )

Delete the above section and the instructions in the sections below before submitting

Description

If this is a feature request, explain why it should be added. Specific use-cases are best.

For bug reports, please provide as much relevant info as possible.

Error Message & Stack Trace

COPY THE ERROR MESSAGE, INCLUDING STACK TRACE HERE

Config

Copy the relevant section from webpack.config.js:

module.exports = {
  entry: 'app.js',
  output: {
    path: 'dist',
    filename: 'index_bundle.js'
  },
  module: {
    rules: [
      ...
    ]
  }
  plugins: [
    new HtmlWebpackPlugin({
      scriptLoading: 'text/javascript'
    }),
    ...
  ]
}

Copy your template file:

<!DOCTYPE html>
<html>
    <head>
        <title>My App</title>
    </head>
    <body>
    </body>
</html>

Relevant Links

  • If your project is public, link to the repo so we can investigate directly.
  • BONUS POINTS: Create a minimal reproduction and upload it to GitHub. This will get you the fastest support.

Environment

Tell us which operating system you are using, as well as which versions of Node.js, npm, webpack, and html-webpack-plugin. Run the following to get it quickly:

node -e "var os=require('os');console.log('Node.js ' + process.version + '\n' + os.platform() + ' ' + os.release())"
npm --version
npm ls webpack
npm ls html-webpack-plugin
@childrentime
Copy link

Unfortunately, this option is not available here. But fortunately, you can customize js files by inheriting the plugin and using getHooks(compilication).alterAssetTagGroups, it's a little troublesome🥹

@alexander-akait
Copy link
Collaborator

Close in favor of #1663

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