Open edarblanco opened 6 years ago
The generic way to implement this is to allow specification of 'package manager args' along with --packageManager
. E.g.
vue create --packageManager yarn --packageManagerArgs '--prefer-offline' app
This would also allow for a .yarnrc
file to be specified.
Vue CLI will honour a .yarnrc
file that's in the new project's directory.
This introduces are chicken-and-egg situation though if you're using a monorepo.
# setup a repo-wide yarnrc file to set prefer-offline mode
echo '--install.prefer-offline' >> .yarnrc
# pre-create the new Vue CLI project directory
mkdir app
# symlink .yarnrc into the project directory
ln -srt app .yarnrc
# create the project, but merge it with the existing directory
vue create --packageManager yarn --merge app
Thanks for the advice, now after trying I get an error that says Unknown option --packageManagerArgs
Sorry, there's no such argument. That message was a suggestion of how the yarn devs could help fix it.
Use the .yarnrc
solution I posted.
What problem does this feature solve?
Create applications disconnected from the internet, previously it was possible to download the templates (vue init webpack --offline) and then install their disconnected dependencies in the same way (yarn install --offline), like me many people in my country do not have a connection stable (constant) and high level (slow), so we handle a huge cache, but it is an alternative that allows us to continue developing very
What does the proposed API look like?
Could not be as it was before? vue create app --offline