Last active
March 13, 2020 22:10
-
-
Save tomsiwik/901c1acb122c9bb18d513bb348b201ea to your computer and use it in GitHub Desktop.
Lerna, Preact-CLI, Workspaces Bug
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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