File tree Expand file tree Collapse file tree 2 files changed +11
-2
lines changed
parcel-transformer-mdx-docs Expand file tree Collapse file tree 2 files changed +11
-2
lines changed Original file line number Diff line number Diff line change @@ -11,8 +11,8 @@ import {Layout} from '@react-spectrum/docs';
11
11
export default Layout ;
12
12
13
13
``` css hidden
14
- @import ' ../../../../ react-aria-components/docs/TextField.mdx' ;
15
- @import ' ../../../../ react-aria-components/docs/Button.mdx' ;
14
+ @import ' react-aria-components/docs/TextField.mdx' ;
15
+ @import ' react-aria-components/docs/Button.mdx' ;
16
16
```
17
17
18
18
---
Original file line number Diff line number Diff line change @@ -19,6 +19,7 @@ const dprint = require('dprint-node');
19
19
const t = require ( '@babel/types' ) ;
20
20
const lightningcss = require ( 'lightningcss' ) ;
21
21
const fs = require ( 'fs' ) ;
22
+ const path = require ( 'path' ) ;
22
23
23
24
const IMPORT_MAPPINGS = {
24
25
'@react-spectrum/theme-default' : {
@@ -179,6 +180,14 @@ module.exports = new Transformer({
179
180
safari : 15 << 16
180
181
} ,
181
182
resolver : {
183
+ resolve ( specifier , parent ) {
184
+ if ( specifier . startsWith ( '.' ) ) {
185
+ return path . resolve ( path . dirname ( parent ) , specifier ) ;
186
+ }
187
+
188
+ let baseDir = process . env . DOCS_ENV === 'production' ? 'docs' : 'packages' ;
189
+ return path . resolve ( options . projectRoot , baseDir , specifier ) ;
190
+ } ,
182
191
read ( filePath ) {
183
192
if ( filePath === `${ asset . filePath } .lightning` ) {
184
193
return cssCode . join ( '\n' ) ;
You can’t perform that action at this time.
0 commit comments