cspotcode / cspotcode/personal-monorepo

[webpack-config-prefabs] Add runtime component to assist with dynamic require access on node

Open
#6 0 comments 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
TypeScript
Stars
5
Forks
1
PR merge metrics
No merged PRs in 30d

Description

It is tricky to write node code that runs in webpack and outside of it, when you need to access stuff like `__non_webpack_require__`. Can we publish a runtime library that makes this easier? E.g. add as a normal dependency, can use at runtime, or can be webpacked into a bundle.

Might be tricky because stuff like the following essentially needs to happen locally within a module:

```
const __require__ = typeof __non_webpack_require__ === 'undefined' ? __non_webpack_require__ : require;
```

The best approach may be to explain these things in the README but not provide any runtime component.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.