Skip to content

Output always includes hash since 7.1 #395

@DysphoricUnicorn

Description

@DysphoricUnicorn

Describe the bug

Because Webpack will use way too much memory when it's left watching files during a whole workday if the output files include a hash in their name, we set it up to only include the hash on production.

This worked fine, however since version 7.1, the output paths will always include a hash, even if the actual files do not.

To Reproduce

This config works fine in 7.0 but breaks in 7.1

output: {
            path: path.join(__dirname, '..', 'static', 'js'),
            publicPath: '/static/js',
            filename: isDevelopment ? 'webapp.[name].js' : 'webapp.[contenthash].js',
        },

Since 7.1, the output will always look like:

{"main":{"js":"./static/js/webapp.[$hash].js"}}

Expected behavior
The output only contains hashes if the file it's referring to does as well.

It should look something like:

{"main":{"js":"./static/js/webapp.main.js"}}

Desktop (please complete the following information):

  • OS: Linux / Docker
  • Node version: 12
  • Plugin version: 7.1.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions