Skip to content
Permalink
Browse files
feat: add support cache busting
  • Loading branch information
talha131 committed Feb 3, 2020
1 parent 2ff79ee commit cde0dc54c68412d8db43ea371e98e6d14e99b9d2
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 9 deletions.
@@ -68,15 +68,18 @@ const watchFiles = () => {
"static/**/*.js",
"!static/**/bootstrap.css",
"!static/**/bootstrap_responsive.css",
"!static/**/elegant.prod.css",
"!static/js/elegant.prod.js"
"!static/**/elegant.prod.e4bd582858.css",
"!static/js/elegant.prod.e4bd582858.js"
],
{ ignoreInitial: false },
buildAll
);
};

const pathProdCSS = path.join(__dirname, "static/css/elegant.prod.css");
const pathProdCSS = path.join(
__dirname,
"static/css/elegant.prod.e4bd582858.css"
);
const rmProdCSS = cb => {
if (fs.existsSync(pathProdCSS)) {
fs.unlinkSync(pathProdCSS);
@@ -93,9 +96,9 @@ const minifyJS = () => {
"static/clipboard/clipboard.js",
"static/js/copy-to-clipboard.js",
"static/js/lunr-search-result.js",
"!static/js/elegant.prod.js"
"!static/js/elegant.prod.e4bd582858.js"
])
.pipe(concat("elegant.prod.js"))
.pipe(concat("elegant.prod.e4bd582858.js"))
.pipe(terser())
.pipe(dest("static/js/"));
};
@@ -113,10 +116,10 @@ const compileCSS = () => {
"static/photoswipe/photoswipe.css",
"static/photoswipe/default-skin/default-skin.css",
"static/css/*.css",
"!static/css/elegant.prod.css"
"!static/css/elegant.prod.e4bd582858.css"
])
.pipe(postcss(plugins))
.pipe(concat("elegant.prod.css"))
.pipe(concat("elegant.prod.e4bd582858.css"))
.pipe(dest("static/css/"));
};

File renamed without changes.
File renamed without changes.
@@ -42,7 +42,7 @@
{% if 'assets' in PLUGINS %}
{% include '_includes/minify_css.html' with context %}
{% else %}
<link rel="stylesheet" type="text/css" href="{{ SITEURL }}/theme/css/elegant.prod.css" media="screen">
<link rel="stylesheet" type="text/css" href="{{ SITEURL }}/theme/css/elegant.prod.e4bd582858.css" media="screen">
<link rel="stylesheet" type="text/css" href="{{ SITEURL }}/theme/css/custom.css" media="screen">
{% endif %}
{% endblock head_links %}
@@ -107,7 +107,7 @@
{% endif %}
<script src="//code.jquery.com/jquery.min.js"></script>
<script src="//netdna.bootstrapcdn.com/twitter-bootstrap/2.3.2/js/bootstrap.min.js"></script>
<script src="{{ SITEURL }}/theme/js/elegant.prod.js"></script>
<script src="{{ SITEURL }}/theme/js/elegant.prod.e4bd582858.js"></script>
<script>
function validateForm(query)
{

0 comments on commit cde0dc5

Please sign in to comment.