Skip to content

Commit

Permalink
Fix require cache
Browse files Browse the repository at this point in the history
  • Loading branch information
xcatliu committed Mar 11, 2017
1 parent 0206450 commit 3d9e773
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion docs/front_matter/index.html
Expand Up @@ -10,7 +10,7 @@ <h1 id="pagic">Pagic</h1>

<footer>
Author: xcatliu,
Published: Thu Mar 02 2017 08:00:00 GMT+0800 (China Standard Time)
Published: Thu Mar 02 2017 08:00:00 GMT+0800 (CST)
</footer>
</body>
</html>
Expand Down
2 changes: 1 addition & 1 deletion package.json
Expand Up @@ -7,7 +7,7 @@
"pagic": "bin/pagic.js"
},
"scripts": {
"start": "node bin/pagic.js -s site",
"start": "node bin/pagic.js build",
"lint": "eslint .",
"test": "npm run lint && _mocha",
"cover": "istanbul cover node_modules/mocha/bin/_mocha",
Expand Down
6 changes: 5 additions & 1 deletion src/util/getLayout.js
Expand Up @@ -10,6 +10,10 @@ module.exports = function getLayout(currentPath) {
return null;
}

const layout = require(path.resolve(layoutDir, '_layout.js'));
const requirePath = path.resolve(layoutDir, '_layout.js');
const layout = require(requirePath);

delete require.cache[require.resolve(requirePath)];

return layout;
};

0 comments on commit 3d9e773

Please sign in to comment.