mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 01:38:56 -04:00
fix: read package file instead of using require
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. Original commit: elastic/kibana-plugin-helpers@f78e891838
This commit is contained in:
parent
7b8cf3c5b7
commit
ca5c47defa
1 changed files with 2 additions and 1 deletions
|
@ -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 = [
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue