react-workspaces / react-workspaces-playground

⚛️ 🐈 Zero Config Create-React-App Monorepos with Yarn Workspaces, Lerna and React Storybook.
https://react-workspaces.github.io/react-workspaces-playground/
765 stars 128 forks source link

"lerna run build" fails on components #14

Closed madrus closed 4 years ago

madrus commented 5 years ago

It would be great if lerna run build command succeeded. But the build fails on components package because it misses index.html file in the public subfolder. See the command output:

$ lerna run --scope @project/components build
info cli using local version of lerna
lerna notice cli v3.16.1
lerna info filter [ '@project/components' ]
lerna info Executing command in 1 package: "yarn run build"
lerna ERR! yarn run build exited 1 in '@project/components'
lerna ERR! yarn run build stdout:
yarn run v1.17.3
$ react-scripts build
Yarn Workspaces paths detected.
Found 2 path(s) with "main:src" entry.
Exporting Workspaces config to Webpack.
{
  root: 'C:\\src\\workspaces\\react-workspaces-playground',
  paths: [],
  packageEntry: 'main:src',
  development: true,
  production: true
}
Could not find a required file.
  Name: index.html
  Searched in: C:\src\workspaces\react-workspaces-playground\packages\components\public
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

lerna ERR! yarn run build stderr:
error Command failed with exit code 1.

lerna ERR! yarn run build exited 1 in '@project/components'
F1LT3R commented 4 years ago

Thank you for pointing this out @madrus !

This should be working now: https://github.com/react-workspaces/react-workspaces-playground/commit/d026eac609e24b4397afde58368a9798905ec23a

Rather than add an unused .html file - which is not relevant for the components, I have removed the build and start scripts from packages/components/package.json.

lerna run build
# ...now passes successfully, building only the apps.
CleanShot 2019-12-22 at 22 48 23@2x