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

[Bug?] hash not stable with same files #1530

Closed
indooorsman opened this issue Aug 18, 2021 · 5 comments
Closed

[Bug?] hash not stable with same files #1530

indooorsman opened this issue Aug 18, 2021 · 5 comments

Comments

@indooorsman
Copy link

indooorsman commented Aug 18, 2021

see attachment. hash changes every build without any file changed. It may be a bug or by design or I missed some configuration?

WX20210818-083532@2x

esbuild.build({
  entryPoints: [entry],
  inject: ['./plugins/react-shim.js'],
  write: true,
  bundle: true,
  minify: false,
  watch: false,
  define: {
    APP_ADVERTISING_VERSION: JSON.stringify({
      version: packageJson.version,
      sparkUIVersion: packageJson.dependencies['spark-ui'],
      buildAt: new Date().toString(),
      buildPlatform: process.platform,
      env: mode
    })
  },
  outdir,
  target: ['chrome80', 'firefox78'],
  sourcemap: 'external',
  splitting: false,
  chunkNames: '[name]-[hash]',
  entryNames: '[name]-[hash]',
  assetNames: '[name]-[hash]',
  publicPath: '/static/advertising',
  logLevel: 'info',
  metafile: false,
  plugins: [aliasPlugin(alias), CssModulesPlugin({ v2: true })],
  loader: {
    '.svg': 'dataurl',
    '.png': 'file'
  }
});
@hyrious
Copy link

hyrious commented Aug 18, 2021

buildAt: new Date().toString(),

It changed.

@indooorsman
Copy link
Author

@hyrious 😢 thanks. but why css files change ?

@indooorsman
Copy link
Author

buildAt: new Date().toString(),

It changed.

I removed it but no luck

@evanw
Copy link
Owner

evanw commented Aug 18, 2021

I can take a look if you can provide self-contained sample code that reproduces the issue. It could potentially be an esbuild bug. Also make sure that the file contents and file paths (including virtual files generated by plugins) are the same between builds.

@indooorsman
Copy link
Author

@evanw oh that's it... my plugin generate virtual files in random path ... 😭

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