Skip to content

Commit

Permalink
Fix no-cache behaviour in inlineAssets
Browse files Browse the repository at this point in the history
  • Loading branch information
astronomersiva committed Apr 14, 2019
1 parent 9ce143d commit ab3a7b8
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion lib/lego.js
Expand Up @@ -63,8 +63,8 @@ module.exports = async function(args) {
await runTask([
...build,
'revisionAssets',
'optimiseImages',
[
'optimiseImages',
'extractCritical',
'inlineAssets',
'generateSiteMap',
Expand Down
4 changes: 2 additions & 2 deletions lib/tasks/copyMajorStaticAssets.js
Expand Up @@ -69,12 +69,12 @@ module.exports = async function(site, options = {}) {
result = contents;
} else {
let cached = cache.getCached('terser', contents);
result = cached;

if (!cached) {
result = terser.minify(contents).code;
cache.setCache('terser', contents, result);
}

result = cached;
}

fs.writeFileSync(destination, result);
Expand Down
2 changes: 1 addition & 1 deletion lib/tasks/inlineAssets.js
Expand Up @@ -2,7 +2,7 @@ module.exports = async function(site) {
const glob = require('glob');
const fs = require('fs-extra');
const path = require('path');
const { inlineSource } = require('inline-source')
const { inlineSource } = require('inline-source');

const { BUILD, STATIC } = require('../utils/constants');

Expand Down

0 comments on commit ab3a7b8

Please sign in to comment.