@514labs/moose-lib 0.6.267-ci-5-gfe9b0c33 → 0.6.267-ci-7-g09e4deda

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.mjs CHANGED
@@ -750,17 +750,23 @@ var loadIndex = async () => {
750
750
  console.log(
751
751
  `${workerInfo} loadIndex: registry cleared in ${Date.now() - clearStart}ms`
752
752
  );
753
- console.log(`${workerInfo} loadIndex: clearing require cache...`);
754
- const cacheStart = Date.now();
755
- const appDir = `${process2.cwd()}/${getSourceDir()}`;
756
- Object.keys(__require.cache).forEach((key) => {
757
- if (key.startsWith(appDir)) {
758
- delete __require.cache[key];
759
- }
760
- });
761
- console.log(
762
- `${workerInfo} loadIndex: require cache cleared in ${Date.now() - cacheStart}ms`
763
- );
753
+ if (process2.env.NODE_ENV !== "production") {
754
+ console.log(`${workerInfo} loadIndex: clearing require cache...`);
755
+ const cacheStart = Date.now();
756
+ const appDir = `${process2.cwd()}/${getSourceDir()}`;
757
+ Object.keys(__require.cache).forEach((key) => {
758
+ if (key.startsWith(appDir)) {
759
+ delete __require.cache[key];
760
+ }
761
+ });
762
+ console.log(
763
+ `${workerInfo} loadIndex: require cache cleared in ${Date.now() - cacheStart}ms`
764
+ );
765
+ } else {
766
+ console.log(
767
+ `${workerInfo} loadIndex: skipping cache clear in production mode`
768
+ );
769
+ }
764
770
  console.log(`${workerInfo} loadIndex: requiring index.ts...`);
765
771
  const requireStart = Date.now();
766
772
  __require(`${process2.cwd()}/${getSourceDir()}/index.ts`);