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

fiename use contenthash,the generated *.js(nomodule) hash is different from the injected hash #7220

Open
thinkmoon opened this issue Jul 4, 2022 · 0 comments

Comments

@thinkmoon
Copy link

thinkmoon commented Jul 4, 2022

Version

5.0.6

Environment info

Environment Info:

  System:
    OS: Windows 10 10.0.19042
    CPU: (8) x64 Intel(R) Core(TM) i7-9700 CPU @ 3.00GHz
  Binaries:
    Node: 16.15.0 - C:\Program Files\nodejs\node.EXE
    Yarn: 1.22.19 - ~\AppData\Roaming\npm\yarn.CMD
    npm: 8.4.1 - C:\Program Files\nodejs\npm.CMD
  Browsers:
    Chrome: Not Found
    Edge: Spartan (44.19041.1266.0), Chromium (103.0.1264.37)
  npmPackages:
    @vue/babel-helper-vue-jsx-merge-props:  1.2.1
    @vue/babel-helper-vue-transform-on:  1.0.2
    @vue/babel-plugin-jsx:  1.1.1
    @vue/babel-plugin-transform-vue-jsx:  1.2.1
    @vue/babel-preset-app:  5.0.4
    @vue/babel-preset-jsx:  1.2.4
    @vue/babel-sugar-composition-api-inject-h:  1.2.1
    @vue/babel-sugar-composition-api-render-instance:  1.2.4
    @vue/babel-sugar-functional-vue:  1.2.2
    @vue/babel-sugar-inject-h:  1.2.2
    @vue/babel-sugar-v-model:  1.2.3
    @vue/babel-sugar-v-on:  1.2.3
    @vue/cli-overlay:  5.0.6
    @vue/cli-plugin-babel: ~5.0.0 => 5.0.4
    @vue/cli-plugin-eslint: ~5.0.0 => 5.0.4
    @vue/cli-plugin-router:  5.0.6
    @vue/cli-plugin-vuex:  5.0.6
    @vue/cli-service: ~5.0.0 => 5.0.6
    @vue/cli-shared-utils:  5.0.6
    @vue/component-compiler-utils:  3.3.0
    @vue/web-component-wrapper:  1.3.0
    babel-helper-vue-jsx-merge-props:  2.0.3
    eslint-plugin-vue: ^8.0.3 => 8.7.1
    vue: 2.6.14 => 2.6.14
    vue-eslint-parser:  8.3.0
    vue-hot-reload-api:  2.3.4
    vue-i18n: 8.27.0 => 8.27.0
    vue-loader:  17.0.0 (15.9.8)
    vue-router: 3.5.3 => 3.5.3
    vue-style-loader:  4.1.3
    vue-template-compiler: ^2.6.14 => 2.6.14
    vue-template-es2015-compiler:  1.9.1
    vuex: 3.6.2 => 3.6.2
  npmGlobalPackages:
    @vue/cli: Not Found

Steps to reproduce

webpack@5.73.0

vue.config.js

  configureWebpack: {
    optimization: {
      realContentHash: false,
    },
    output: {
      filename: 'static/js/[name].[contenthash].bundle.js',
      chunkFilename: 'static/js/[name].[contenthash].chunk.js',
    }
}

run vue-cli-service build

when realcontenthash is true

  <script defer="defer" src="static/js/chunk-vendors.aededfca88666629.bundle.js" nomodule></script>
  <script defer="defer" src="static/js/app.e107039f1667fd4d.bundle.js" nomodule></script>

The two *.js file do not exist,Specifically, the generated js(only nomodule) hash is different from the injected hash.

if realcontenthash is false,they hash is same

What is expected?

the generated js hash is same as the injected hash

What is actually happening?

the generated js hash is different from the injected hash


I am sorry, I'm not very good at English.
I am very sorry. Due to company policy, I can't leave any demo code or screenshots.
I hope someone can help me.

@thinkmoon thinkmoon changed the title fiename use contenthash, the *.js injected into the HTML file does not exist. fiename use contenthash,the generated *.js(only nomodule) hash is different from the injected hash Jul 4, 2022
@thinkmoon thinkmoon changed the title fiename use contenthash,the generated *.js(only nomodule) hash is different from the injected hash fiename use contenthash,the generated *.js(nomodule) hash is different from the injected hash Jul 4, 2022
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

1 participant