From 53be77aadead4f0003f123762e1125a028070fa6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sascha=20I=C3=9Fbr=C3=BCcker?= Date: Wed, 5 Oct 2022 10:00:13 +0200 Subject: [PATCH] Fix static file dir warning (#350) --- .gitignore | 4 +++- rollup.config.js | 3 ++- siteroot/settings/base.py | 5 ++--- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/.gitignore b/.gitignore index d490bf8..26b2be9 100644 --- a/.gitignore +++ b/.gitignore @@ -182,7 +182,9 @@ typings/ ### Custom # Rollup compilation output -/build +/bookmarks/static/bundle.js* +# SASS compilation output +/bookmarks/static/theme-*.css* # Collected static files for deployment /static # Build output, etc. diff --git a/rollup.config.js b/rollup.config.js index bfcc935..270bb06 100644 --- a/rollup.config.js +++ b/rollup.config.js @@ -11,7 +11,8 @@ export default { sourcemap: true, format: 'iife', name: 'linkding', - file: 'build/bundle.js' + // Generate bundle in static folder to that it is picked up by Django static files finder + file: 'bookmarks/static/bundle.js' }, plugins: [ svelte({ diff --git a/siteroot/settings/base.py b/siteroot/settings/base.py index 32a6eae..7462601 100644 --- a/siteroot/settings/base.py +++ b/siteroot/settings/base.py @@ -138,7 +138,7 @@ STATIC_ROOT = os.path.join(BASE_DIR, 'static') # Turn off SASS compilation by default SASS_PROCESSOR_ENABLED = False # Location where generated CSS files are saved -SASS_PROCESSOR_ROOT = os.path.join(BASE_DIR, 'tmp', 'build', 'styles') +SASS_PROCESSOR_ROOT = os.path.join(BASE_DIR, 'bookmarks', 'static') # Add SASS preprocessor finder to resolve generated CSS STATICFILES_FINDERS = [ @@ -147,9 +147,8 @@ STATICFILES_FINDERS = [ 'sass_processor.finders.CssFinder', ] -# Include SASS styles into static path, otherwise they can not be found by the SASS preprocessor +# Enable SASS processor to find custom folder for SCSS sources through static file finders STATICFILES_DIRS = [ - os.path.join(BASE_DIR, 'build'), os.path.join(BASE_DIR, 'bookmarks', 'styles'), ]