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

Commit

Permalink
fix(logservice): fix issue with latest verstion of util package ref…
Browse files Browse the repository at this point in the history
…erencing `process`
  • Loading branch information
ostowe committed Jul 23, 2021
1 parent 47eac83 commit 74dc231
Show file tree
Hide file tree
Showing 5 changed files with 90 additions and 11 deletions.
3 changes: 3 additions & 0 deletions packages/core/config/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ module.exports = (env, argv) => {
extensions,
alias: client.getAlias(),
symlinks: !isProd,
fallback: {
util: require.resolve('util'),
},
},
devtool: client.getDevTool(),
entry: client.getEntry(),
Expand Down
6 changes: 6 additions & 0 deletions packages/core/config/webpack/plugins.js
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,9 @@ module.exports = function getPlugins(context, argv) {
filename: '[name].[contenthash].css',
chunkFilename: '[id].[contenthash].css',
}),
new webpack.ProvidePlugin({
process: 'process/browser',
}),
(analyze && new BundleAnalyzerPlugin()),
].filter(Boolean);

Expand All @@ -109,6 +112,9 @@ module.exports = function getPlugins(context, argv) {
filename: '[name].css',
chunkFilename: '[id].css',
}),
new webpack.ProvidePlugin({
process: 'process/browser',
}),
];

default:
Expand Down
87 changes: 77 additions & 10 deletions packages/core/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions packages/core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@
"mini-css-extract-plugin": "~1.3.6",
"node-fetch": "^2.6.0",
"nodemon": "^2.0.3",
"process": "~0.11.10",
"prop-types": "^15.7.2",
"query-string": "^6.13.1",
"react": "^17.0.1",
Expand All @@ -102,6 +103,7 @@
"url-loader": "~4.1.1",
"url-parse": "^1.4.7",
"url-pattern": "^1.0.3",
"util": "~0.12.4",
"webpack": "~5.37.0",
"webpack-bundle-analyzer": "~4.4.0",
"webpack-cli": "~4.6.0",
Expand Down
3 changes: 2 additions & 1 deletion packages/core/services/logService/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
const { format } = require('util');
const defaultService = require('./defaultService');
const monitor = require('../monitorService/getService')();
const getEnv = require('../../utils/universalEnv');

let service;

Expand All @@ -15,7 +16,7 @@ let service;
* @return {function} A logging function.
*/
const getService = (namespace) => {
const env = process.env.NODE_ENV;
const { NODE_ENV: env } = getEnv();

// Memoize service, so it can reused.
if (service) {
Expand Down

0 comments on commit 74dc231

Please sign in to comment.