Skip to content

Instantly share code, notes, and snippets.

@rafaelrinaldi
Created March 24, 2017 18:40
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 rafaelrinaldi/8e3485e7dbf116bf8ba1512a4253fc88 to your computer and use it in GitHub Desktop.
Save rafaelrinaldi/8e3485e7dbf116bf8ba1512a4253fc88 to your computer and use it in GitHub Desktop.
# This script will take care of react-specific imports just so
# Preact can do its job (production only)
modules=./node_modules
bin=$modules/.bin
replace=$bin/replace
pattern="require\('react\/lib\/ReactDOMFactories'\)"
target=$modules/remarkable-react/lib/lib/renderer.js
if [ ! -d "$modules" ]; then
echo 'No dependencies found. Run `yarn` or `npm i`.'
exit
fi
echo 'Replacing strings...'
$replace $pattern '{}' $target
echo 'Done'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment