-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add an experimental helper script to expose the component locally whe…
…n debugging See facebook/create-react-app#7993 (comment) for how this is used.
- Loading branch information
Showing
2 changed files
with
20 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,6 +15,7 @@ storybook-static/ | |
|
||
# development workflows | ||
.node_modules/ | ||
exposed/ | ||
|
||
*.orig | ||
*.rej | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
#!/bin/sh | ||
|
||
exposed_directory=${PWD}/exposed | ||
|
||
# Clean out the exposed directory and recreate it | ||
rm -rf "${exposed_directory}" && mkdir -p "${exposed_directory}" | ||
|
||
# Link the various pieces we need to make it look like our package | ||
for f in src $(node -p '(require("./package.json").files || []).join("\n")'); do | ||
ln -s "../${f}" "${exposed_directory}/${f}" | ||
done | ||
# Hardlink files such as package.json to prevent smart tools trying to bork things. | ||
for f in package.json; do | ||
ln "${f}" "${exposed_directory}/${f}" | ||
done | ||
(cd "${exposed_directory}" && NODE_ENV=production npm link) | ||
|
||
npm install | ||
npm run build -- --watch |