|
1 |
| -import { initWasm, SWCOptions, TransformOptions, transpileSync } from '../compiler/mod.ts' |
2 |
| -import { checksum as compilerChecksum } from '../compiler/wasm-checksum.js' |
| 1 | +import { buildChecksum, initWasm, SWCOptions, TransformOptions, transpileSync } from '../compiler/mod.ts' |
3 | 2 | import type { AcceptedPlugin, ECMA, ServerRequest } from '../deps.ts'
|
4 | 3 | import { CleanCSS, colors, ensureDir, minify, path, postcss, Sha1, Sha256, walk } from '../deps.ts'
|
5 | 4 | import { EventEmitter } from '../framework/core/events.ts'
|
@@ -1086,7 +1085,7 @@ export class Project {
|
1086 | 1085 |
|
1087 | 1086 | if (fsync) {
|
1088 | 1087 | if (!options?.bundleMode) {
|
1089 |
| - mod.hash = (new Sha1).update(compilerChecksum).update(jsContent).hex() |
| 1088 | + mod.hash = (new Sha1).update(buildChecksum).update(jsContent).hex() |
1090 | 1089 | mod.jsFile = path.join(saveDir, name + (isRemote ? '' : `.${mod.hash.slice(0, hashShort)}`) + '.js')
|
1091 | 1090 | await cleanupCompilation(mod.jsFile)
|
1092 | 1091 | await Promise.all([
|
@@ -1142,7 +1141,7 @@ export class Project {
|
1142 | 1141 | }
|
1143 | 1142 | return s
|
1144 | 1143 | })
|
1145 |
| - mod.hash = (new Sha1).update(compilerChecksum).update(jsContent).hex() |
| 1144 | + mod.hash = (new Sha1).update(buildChecksum).update(jsContent).hex() |
1146 | 1145 | mod.jsFile = `${mod.jsFile.replace(reHashJs, '')}.${mod.hash.slice(0, hashShort)}.js`
|
1147 | 1146 | cleanupCompilation(mod.jsFile).then(() => {
|
1148 | 1147 | Promise.all([
|
@@ -1283,7 +1282,7 @@ export class Project {
|
1283 | 1282 |
|
1284 | 1283 | // create and copy polyfill
|
1285 | 1284 | const polyfillMode = newModule('/polyfill.js')
|
1286 |
| - const hash = (new Sha1).update(compilerChecksum).update(AlephRuntimeCode).update(`${this.config.buildTarget}-${VERSION}`).hex() |
| 1285 | + const hash = (new Sha1).update(buildChecksum).update(AlephRuntimeCode).update(`${this.config.buildTarget}-${VERSION}`).hex() |
1287 | 1286 | const polyfillFile = path.join(this.buildDir, `polyfill.${hash.slice(0, hashShort)}.js`)
|
1288 | 1287 | if (!existsFileSync(polyfillFile)) {
|
1289 | 1288 | const rawPolyfillFile = `${alephPkgUrl}/compiler/polyfills/${this.config.buildTarget}/polyfill.js`
|
@@ -1311,7 +1310,7 @@ export class Project {
|
1311 | 1310 | }).flat().join('\n')
|
1312 | 1311 | const bundlingCode = imports
|
1313 | 1312 | const mod = newModule(`/${name}.bundling.js`)
|
1314 |
| - const hash = (new Sha1).update(compilerChecksum).update(header).update(bundlingCode).hex() |
| 1313 | + const hash = (new Sha1).update(buildChecksum).update(header).update(bundlingCode).hex() |
1315 | 1314 | const bundlingFile = path.join(this.buildDir, mod.url)
|
1316 | 1315 | const bundleFile = path.join(this.buildDir, `${name}.bundle.${hash.slice(0, hashShort)}.js`)
|
1317 | 1316 | const saveAs = path.join(this.outputDir, `_aleph/${name}.${hash.slice(0, hashShort)}.js`)
|
|
0 commit comments