This repository was archived by the owner on Jan 24, 2025. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
This repository was archived by the owner on Jan 24, 2025. It is now read-only.
Yarn workspaces support #225
Copy link
Copy link
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
Bug Report
Describe the bug
Compilation fail when importing components from another yarn workspace.
To Reproduce
- Create one
docz
workspace and oneshared
workspace - Create components on
shared
- Import them on
docz
- See error
Module parse failed: Unexpected token (11:2)
You may need an appropriate loader to handle this file type.
|
| export default () => (
> <Touchable onPress={() => alert('pressed')}>
| <Text style={styles.text}>Shared Button</Text>
| </Touchable>
@ ./src/index.mdx 9:0-61 66:93-99
@ ./.docz/app/imports.js
@ ./.docz/app/index.jsx
@ multi ../node_modules/docz-core/node_modules/babel-polyfill/lib/index.js ./.docz/app/index.jsx
Environment
- OS: macOS 10.14
- Node/npm version: Node 8.11.3 / npm 5.6
Additional context/Screenshots
If I move the docz code to shared
it will work. It only works if the components are in the same "project". If you try to import from another workspace it fails.
If you setup docz in the root directory (outside all workspaces) it fails as well, but with another error.
doczrc.js
module.exports = {
themeConfig: {
colors: {
primary: 'black',
},
},
typescript: true,
}
docz package.json
{
"name": "docz",
"version": "0.0.1",
"scripts": {
"start": "docz dev",
"build": "docz build"
},
"dependencies": {
"shared": "0.0.1"
},
"devDependencies": {
"docz": "^0.10.2"
}
}
docz/src/index.mdx
---
name: Hello world
---
import Button from 'shared/src/components/common/Button.tsx'
# Hello world
<Button>Click</Button>
easybird, brecht, bogdansoare, deini, brianespinosa and 2 more
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working