Skip to content

Instantly share code, notes, and snippets.

@patrickmarabeas
Last active June 23, 2017 03:26
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 patrickmarabeas/6ca0c1f37ac9f86bcd99348f77e1302e to your computer and use it in GitHub Desktop.
Save patrickmarabeas/6ca0c1f37ac9f86bcd99348f77e1302e to your computer and use it in GitHub Desktop.
Multiple package version dependencies
import DayPicker as foo from 'react-day-picker@5.2.0'
import DayPicker as bar from 'react-day-picker@5.2.1'
import DayPicker as baz from 'react-day-picker@5.2.2'
#!/bin/bash
# dependency package version
dependency() {
yarn add $1@$2
mv node_modules/$1 legacy_modules/$1@$2
# Makes the whole process slower, but doesn't fill up package.json with cruft
yarn remove $1
}
mkdir legacy_modules
# List dependencies and versions below:
# TODO: hoist this config into package.json; package as modules
dependency react-day-picker 5.2.2
dependency react-day-picker 5.2.1
dependency react-day-picker 5.2.0
resolve: {
modules: [path.resolve('./legacy_modules'), 'node_modules']
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment