Skip to content

emitted data:text/javascript,__webpack_public_path__ = htmlWebpackPluginPublicPath; #1589

@await-ovo

Description

@await-ovo

Current behaviour 💣

after using webpack 5 build, seen that a file named 01b0bacef142817ca1a5 emitted in dist, which content is:

__webpack_public_path__ = htmlWebpackPluginPublicPath;

image

Expected behaviour ☀️

I'm not sure if this is the correct behavior and what this file does.

can i ignore this file by plugin like ignore-emit-webpack-plugin ?

Reproduction Example 👾

my webpack.config.js as below:

module.exports = {
  "mode": "production",
  entry: {
    'app': './src/index.js'
  },
  module: {
    rules: [
      {
        test: /\.svg$/,
        use: ['@svgr/webpack', 'url-loader'],
        type: 'javascript/auto'
      },
      // fallback for other asset modules
      {
        exclude: [/\.(svg|js|jsx|ts|tsx|html)$/],
        type: 'asset/resource',
      }
    ]
  },
  optimization: {
    minimize: false,
    runtimeChunk: {
      name: entrypoint => `runtime~${entrypoint.name}`
    },
    splitChunks: {
      chunks: 'all'
    }
  },
  plugins: [
    new HtmlWebpackPlugin({
      filename: 'index.html',
      template: './index.html'
    }),
  ]
}

Environment 🖥

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions