Skip to content
Snippets Groups Projects
Commit f47557e2 authored by Robert Long's avatar Robert Long
Browse files

Disable file hash cache busting query strings to fix production builds.

parent aaa18093
No related branches found
No related tags found
No related merge requests found
...@@ -17,30 +17,31 @@ module.exports = { ...@@ -17,30 +17,31 @@ module.exports = {
return new Handlebars.SafeString(assetPath); return new Handlebars.SafeString(assetPath);
} }
const compilation = options.data.root.compilation; // const compilation = options.data.root.compilation;
let asset; // let asset;
if (compilation.assets[assetPath]) { // if (compilation.assets[assetPath]) {
asset = compilation.assets[assetPath].source(); // asset = compilation.assets[assetPath].source();
} else { // } else {
const outputPath = options.data.root.compiler.options.output.path; // const outputPath = options.data.root.compiler.options.output.path;
const localPath = path.join(outputPath, assetPath); // const localPath = path.join(outputPath, assetPath);
try { // try {
asset = fs.readFileSync(localPath); // asset = fs.readFileSync(localPath);
} catch (err) { // } catch (err) {
compilation.errors.push( // compilation.errors.push(
err.message + // err.message +
" Availible assets: " + // " Availible assets: " +
Object.keys(compilation.assets).jojn(", ") // Object.keys(compilation.assets).jojn(", ")
); // );
} // }
} // }
const hash = crc.crc32(asset).toString(16); // const hash = crc.crc32(asset).toString(16);
// const cacheBustQueryString = "?crc=" + hash;
const cacheBustQueryString = "?d=" + Date.now();
const baseAssetsPath = options.data.root.baseAssetsPath || ""; const baseAssetsPath = options.data.root.baseAssetsPath || "";
const cacheBustQueryString = "?crc=" + hash;
const url = baseAssetsPath + assetPath + cacheBustQueryString; const url = baseAssetsPath + assetPath + cacheBustQueryString;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment