webpack-dynamic-hash
Advanced tools
Comparing version 1.0.8 to 1.1.7
39
index.js
@@ -66,5 +66,5 @@ /** | ||
// .js'$ | ||
var out = text.replace(/(lib-)(.*)(\.js)/g, "lib" + libHash + ".js"); | ||
out = out.replace(/(app-)(.*)(\.js)/g, "app" + appHash + ".js"); | ||
out = out.replace(/(app-)(.*)(\.c)/g, "app" + cssHash + ".c"); | ||
var out = text.replace(/(lib-)([^-]*)(\.js)/, "lib" + libHash + ".js"); | ||
out = out.replace(/(app-)([^-]*)(\.js)/, "app" + appHash + ".js"); | ||
out = out.replace(/(app-)([^-]*)(\.css)/, "app" + cssHash + ".css"); | ||
fs.writeFileSync(path.join(__dirname, init), out); | ||
@@ -74,20 +74,17 @@ }; | ||
getAppHash(app); | ||
setTimeout(function () { | ||
fs.exists(path.join(__dirname, 'build/js/' + init + initHash + '.js'), function(result) { | ||
if (result) { | ||
fs.rename('build/js/' + init + initHash + '.js', 'build/js/' + init + '.js', function (err) { | ||
if (err) { | ||
console.log(err); | ||
} else { | ||
changeFile('build/js/' + init + '.js'); | ||
} | ||
}) | ||
} else { | ||
changeFile('build/js/' + init + '.js'); | ||
} | ||
}) | ||
}, 20 ); | ||
fs.exists(path.join(__dirname, 'build/js/' + init + '.js'), function(result) { | ||
if (!result) { | ||
fs.rename('build/js/' + init + initHash + '.js', 'build/js/' + init + '.js', function (err) { | ||
if (err) { | ||
console.log(err); | ||
} else { | ||
changeFile('build/js/' + init + '.js'); | ||
} | ||
}) | ||
} else { | ||
changeFile('build/js/' + init + '.js'); | ||
} | ||
}) | ||
}; | ||
} | ||
fs.exists(path.join(__dirname, 'build'), function(result) { | ||
@@ -105,5 +102,5 @@ compiler.plugin('done', function (stats) { | ||
} catch (e) { | ||
console.log(e); | ||
} | ||
@@ -110,0 +107,0 @@ }; |
{ | ||
"name": "webpack-dynamic-hash", | ||
"version": "1.0.8", | ||
"version": "1.1.7", | ||
"main": "index.js", | ||
@@ -5,0 +5,0 @@ "scripts": { |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
AI-detected possible typosquat
Supply chain riskAI has identified this package as a potential typosquat of a more popular package. This suggests that the package may be intentionally mimicking another package's name, description, or other metadata.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
4836
98
1