Skip to content
This repository has been archived by the owner on Jan 31, 2024. It is now read-only.

Commit

Permalink
fix: read package file instead of using require
Browse files Browse the repository at this point in the history
require uses a cache, so if the package.json file was changed before running build, the changes won't exist in the build runtime. using fs.readFileSync instead ensures that the information read from package.json is current.
  • Loading branch information
w33ble committed Nov 6, 2017
1 parent 11238b2 commit f78e891
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/plugin_config.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
const resolve = require('path').resolve;
const statSync = require('fs').statSync;
const readFileSync = require('fs').readFileSync;
const configFile = require('./config_file');

module.exports = function (root) {
if (!root) root = process.cwd();

const pkg = require(resolve(root, 'package.json'));
const pkg = JSON.parse(readFileSync(resolve(root, 'package.json')));
const config = configFile(root);

const buildSourcePatterns = [
Expand Down

0 comments on commit f78e891

Please sign in to comment.