django-require icon indicating copy to clipboard operation
django-require copied to clipboard

Add paths to REQUIRE_EXCLUDE

Open Tyrdall opened this issue 9 years ago • 4 comments

Hi, I need to speed up my deployments. Therefore I want to exclude some scripts from optimization, for example, 'ckeditor/ckeditor/ckeditor.js' and all its dependencies and plugins. Currently it takes minutes to run collectstatic, so is there any best practice to add whole paths to the REQUIRE_EXCLUDE setting, like 'ckeditor'.

Tyrdall avatar Feb 15 '16 10:02 Tyrdall

There's no functionality to do this at present. You could perform a glob within your settings.py file.

Alternatively, I'll take a pull request that adds glob support to the REQUIRE_EXCLUDE setting.

On Mon, 15 Feb 2016 at 10:02 Tobias Lorenz [email protected] wrote:

Hi, I need to speed up my deployments. Therefore I want to exclude some scripts from optimization, for example, 'ckeditor/ckeditor/ckeditor.js' and all its dependencies and plugins. Currently it takes minutes to run collectstatic, so is there any best practice to add whole paths to the REQUIRE_EXCLUDE setting, like 'ckeditor'.

— Reply to this email directly or view it on GitHub https://github.com/etianen/django-require/issues/66.

etianen avatar Feb 15 '16 13:02 etianen

yea, I'd also like to exclude the node_modules directory for example.

thijstriemstra avatar Feb 17 '16 15:02 thijstriemstra

How about using a regex?

Something like: https://github.com/Tyrdall/django-require/commit/115d2ff30943458f58bcea5eaebe314cddae94b4

To exclude some files from uglyfying you can use the following setting in your app.built.js:

({
    fileExclusionRegExp: /^(folder1|folder2|folder3)$/

})

Tyrdall avatar Feb 18 '16 07:02 Tyrdall

I suppose that the Django convention is to use a regex, rather than a glob pattern.

On Thu, 18 Feb 2016 at 07:04 Tobias Lorenz [email protected] wrote:

How about using a regex?

Something like: Tyrdall@115d2ff https://github.com/Tyrdall/django-require/commit/115d2ff30943458f58bcea5eaebe314cddae94b4

— Reply to this email directly or view it on GitHub https://github.com/etianen/django-require/issues/66#issuecomment-185570760 .

etianen avatar Feb 18 '16 09:02 etianen