Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support to work with yarn workspaces #3638

Closed
1 task done
matiasfha opened this issue Jan 30, 2018 · 2 comments · Fixed by #5034
Closed
1 task done

Add support to work with yarn workspaces #3638

matiasfha opened this issue Jan 30, 2018 · 2 comments · Fixed by #5034

Comments

@matiasfha
Copy link
Contributor

matiasfha commented Jan 30, 2018

Current Behavior

Based on what I have:
I have a folder estructure working with yarn workspaces with multiple workspaces like:

|-- packages
|-- .babelrc
..
..
..
|----- shared
|-------- components // named @org/components
|-------- utils // named @org/utils
|----- web
|------- app // named @org/mainApp
|--------- src
|------------ next.config.js
|------------ .babelrc
|----------- pages
....
...
|------- otherPackage // named @org/otherPackage

Where app folder is a next.js app that import code from the other components.

The dev mode of next is run from root folder using npm run web that call next packages/web/app/src to allow next to found the pages folder (and next.config.js and .babelrc )

After run and start compiling, and get the "success" mensaje, some errors arise in the console on web loaded.
Errors referring to the use of type and import keywords in the files that comes from the imported modules (modules named as @org/ that lives inside the same repo but (maybe) in other workspaces).

This means that next webpack configuration is not transpiling the imported files. (the babel-plugin-transform-flow-strip-types is installed in packages/web/app and also in the root folder)

Expected Behavior

Should not have any error with the imported files and works as expected (no problem with es6 and flow).

Steps to Reproduce (for bugs)

  1. Create a project with yarn workspaces activated
  2. Create at least two workspaces
  3. Create a package inside a workspace that run with next
  4. Import file from other workspaces

Context

Your Environment

Tech Version
next 4.2.3
node 9.3.0
OS macosx
browser safari/chrome
yarn 1.3.2
@bogdansoare
Copy link

Any news on this?

timneutkens pushed a commit that referenced this issue Sep 3, 2018
> Workspaces are a new way to setup your package architecture that’s available by default starting from Yarn 1.0. It allows you to setup multiple packages in such a way that you only need to run yarn install once to install all of them in a single pass.

- [x] Tested in development mode
- [x] Tested in production mode
- [x] Tested with deployment https://with-yarn-workspaces-hwzubdlkul.now.sh/
- [x] Added transpile module example

Closes #3638
@beku8
Copy link

beku8 commented Sep 24, 2018

webpackDivMiddleware watch options are not working properly. This example is not picking up the changes from bar/ directory. Should we open a new issue?

@lock lock bot locked as resolved and limited conversation to collaborators Sep 24, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants