@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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/next.js +16 -7
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@astryxdesign/build",
3
- "version": "0.1.8",
3
+ "version": "0.1.9",
4
4
  "description": "Build plugins for XDS source builds — babel, PostCSS, and Vite integrations",
5
5
  "author": "Meta Open Source",
6
6
  "license": "MIT",
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
- // Resolve to source exports
39
- config.resolve.conditionNames = [
40
- 'source',
41
- 'import',
42
- 'require',
43
- 'default',
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