Skip to content

Commit

Permalink
Added, support add timestamp for external files
Browse files Browse the repository at this point in the history
  • Loading branch information
haifeng2013 committed Sep 5, 2018
1 parent 3bdd3b4 commit 47332f5
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,11 @@ export default (opt = {}) => {
writeFileSync(file, code);
}

const src = isURL(file) ? file : relative(destDir, file);
let src = isURL(file) ? file : relative(destDir, file);

if (node.timestamp) {
src += '?t=' + (new Date()).getTime();
}

if (type === 'js') {
const script = `<script type="text/javascript" src="${src}"></script>\n`;
Expand Down

0 comments on commit 47332f5

Please sign in to comment.