diff --git a/templates/helpers.js b/templates/helpers.js index 5f66a4cf333da3cbd372c30e49b585725c71fe51..44b58374b9e6d816b89d917d48e7fa3e4d691527 100644 --- a/templates/helpers.js +++ b/templates/helpers.js @@ -17,30 +17,31 @@ module.exports = { return new Handlebars.SafeString(assetPath); } - const compilation = options.data.root.compilation; - - let asset; - if (compilation.assets[assetPath]) { - asset = compilation.assets[assetPath].source(); - } else { - const outputPath = options.data.root.compiler.options.output.path; - const localPath = path.join(outputPath, assetPath); - - try { - asset = fs.readFileSync(localPath); - } catch (err) { - compilation.errors.push( - err.message + - " Availible assets: " + - Object.keys(compilation.assets).jojn(", ") - ); - } - } - - const hash = crc.crc32(asset).toString(16); + // const compilation = options.data.root.compilation; + + // let asset; + // if (compilation.assets[assetPath]) { + // asset = compilation.assets[assetPath].source(); + // } else { + // const outputPath = options.data.root.compiler.options.output.path; + // const localPath = path.join(outputPath, assetPath); + + // try { + // asset = fs.readFileSync(localPath); + // } catch (err) { + // compilation.errors.push( + // err.message + + // " Availible assets: " + + // Object.keys(compilation.assets).jojn(", ") + // ); + // } + // } + + // const hash = crc.crc32(asset).toString(16); + // const cacheBustQueryString = "?crc=" + hash; + const cacheBustQueryString = "?d=" + Date.now(); const baseAssetsPath = options.data.root.baseAssetsPath || ""; - const cacheBustQueryString = "?crc=" + hash; const url = baseAssetsPath + assetPath + cacheBustQueryString;