Skip to content

Instantly share code, notes, and snippets.

@tomsiwik
Last active March 13, 2020 22:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tomsiwik/901c1acb122c9bb18d513bb348b201ea to your computer and use it in GitHub Desktop.
Save tomsiwik/901c1acb122c9bb18d513bb348b201ea to your computer and use it in GitHub Desktop.
Lerna, Preact-CLI, Workspaces Bug
#!/bin/sh
# Initializing Lerna
npx lerna init;
# Setup Workspaces
cat <<EOF > package.json
{
"name": "root",
"private": true,
"devDependencies": {
"lerna": "^3.20.2"
},
"workspaces": [
"packages/mypack"
]
}
EOF
cat <<EOF > lerna.json
{
"packages": [
"packages/mypack"
],
"version": "0.0.0",
"npmClient": "yarn",
"useWorkspaces": true
}
EOF
# Create default preact project
cd packages/;
npx preact create default mypack;
# Let lerna manage node_modules with bootstrap command below
rm -rf mypack/node_modules/;
# Bootstrap lerna
cd ..;
npx lerna bootstrap;
# Run build (this will print error)
npx lerna exec --scope mypack yarn build;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment