Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to exclude files from pub publish for Dart packages?

Is there any way to exclude certain files or directories from pub publish for dart packages?

I am publishing a package that has so many screenshots. I want them to upload on GitHub but not on Pub.Dev. The intention behind this is to reduce the package size.

like image 964
Shahzad Akram Avatar asked Jun 02 '20 17:06

Shahzad Akram


People also ask

What is Pubspec lock for?

lock file lets you test your package against the latest compatible versions of its dependencies. For application packages, we recommend that you commit the pubspec.

Should Pubspec lock be ignored?

If you are working on an application package, then you should keep the pubspec. lock file in your repository as a snapshot of your dependencies.


Video Answer


2 Answers

You can now create a .pubignore file to do this. See this PR for more details on how this works.

like image 163
Prerak Mann Avatar answered Oct 26 '22 13:10

Prerak Mann


Clearing git cache from my PC works for me:

git rm -r --cached .

like image 1
Abbas Jafari Avatar answered Oct 26 '22 12:10

Abbas Jafari