react-client 1.0.15 → 1.0.16

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.
@@ -174,6 +174,11 @@ async function dev() {
174
174
  return res.end(transformCache.get(filePath));
175
175
  }
176
176
  let code = await fs_extra_1.default.readFile(filePath, 'utf8');
177
+ // 🧩 Rewrite bare imports (react, react-dom, etc.) to /@modules/*
178
+ code = code
179
+ .replace(/\bfrom\s+['"]([^'".\/][^'"]*)['"]/g, (_match, dep) => `from "/@modules/${dep}"`)
180
+ .replace(/\bimport\(['"]([^'".\/][^'"]*)['"]\)/g, (_match, dep) => `import("/@modules/${dep}")`);
181
+ // Run plugin transforms
177
182
  for (const p of plugins) {
178
183
  if (p.onTransform)
179
184
  code = await p.onTransform(code, filePath);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-client",
3
- "version": "1.0.15",
3
+ "version": "1.0.16",
4
4
  "description": "react-client is a lightweight CLI and runtime for building React apps with fast iteration.",
5
5
  "license": "MIT",
6
6
  "author": "Venkatesh Sundaram",