@astryxdesign/build 0.1.8 → 0.1.9
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/package.json +1 -1
- package/src/next.js +16 -7
package/package.json
CHANGED
package/src/next.js
CHANGED
|
@@ -35,13 +35,22 @@ function withAstryx(nextConfig = {}) {
|
|
|
35
35
|
...nextConfig,
|
|
36
36
|
transpilePackages: merged,
|
|
37
37
|
webpack: (config, context) => {
|
|
38
|
-
//
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
38
|
+
// Astryx packages are consumed from their `source` export (raw TS) so
|
|
39
|
+
// the sandbox/docsite build straight from src without a prebuild step.
|
|
40
|
+
// Apply the `source` condition via a scoped, ALLOWLIST rule that only
|
|
41
|
+
// matches @astryxdesign packages — the global conditions stay as Next's
|
|
42
|
+
// defaults (webpack's `'...'` sentinel + react-server), which React JSX
|
|
43
|
+
// resolution depends on. Third-party deps (e.g. `lexical`, which also
|
|
44
|
+
// ships a `source` export) therefore resolve to their built output, not
|
|
45
|
+
// raw TS. This is robust to new third-party `source`-shipping deps.
|
|
46
|
+
config.module = config.module || {};
|
|
47
|
+
config.module.rules = config.module.rules || [];
|
|
48
|
+
config.module.rules.unshift({
|
|
49
|
+
test: /[\\/]node_modules[\\/]@astryxdesign[\\/]/,
|
|
50
|
+
resolve: {
|
|
51
|
+
conditionNames: ['source', '...'],
|
|
52
|
+
},
|
|
53
|
+
});
|
|
45
54
|
|
|
46
55
|
// Preserve the symlinked node_modules path so Next.js's
|
|
47
56
|
// transpilePackages matcher recognizes @astryxdesign/* packages under
|