wmr
wmr copied to clipboard
How to import a specific version of package from npm?
With npm or yarn (or whatever package manager you're using) you can install specific versions via:
npm install <package>@<version>
Example: npm install [email protected]
Does wmr support to import a specific version of package without installation?
something like: import '[email protected]'
Just tried it out and it looks like it's not supported.
Hmm - importing with a version should already be supported, but it does seem like we've mucked something up here.
FWIW you can use the "resolutions"
or "dependencies"
package.json fields to control versioning and WMR will respect that:
{
"dependencies": {
"preact": "^10.5.7"
},
"resolutions": {
"unistore": "3.0.0",
"@material/*": "5"
}
}