Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/n1k0r/django-esbuild
An example of an esbuild configuration to be used in a Django project.
https://github.com/n1k0r/django-esbuild
django esbuild javascript project-template sass
Last synced: 3 days ago
JSON representation
An example of an esbuild configuration to be used in a Django project.
- Host: GitHub
- URL: https://github.com/n1k0r/django-esbuild
- Owner: n1k0r
- Created: 2024-04-03T20:15:12.000Z (8 months ago)
- Default Branch: master
- Last Pushed: 2024-04-07T08:11:39.000Z (7 months ago)
- Last Synced: 2024-04-07T09:24:18.522Z (7 months ago)
- Topics: django, esbuild, javascript, project-template, sass
- Language: Python
- Homepage:
- Size: 13.7 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Django + esbuild project example
The most notable part of this repository is the [build.mjs](build.mjs) script, which builds scripts and styles from `*/src/` into `*/static/`. Paths that contain parts prefixed with an underscore (e.g., `_bundle/` and `_module.js`) are ignored but can be used in imports. This script can be used in watch mode with the argument `--watch` (see scripts in `package.json`).
In this example there are two applications:
* `main` defines the basic layout;
* `buttons` serve form with bundled scripts.These applications are being built like this:
```mermaid
flowchart LR
subgraph src
src_buttons_colored[buttons/src/buttons/_bundle/colored.ts]
src_buttons_sized[buttons/src/buttons/_bundle/sized.ts]
src_buttons_bundle[buttons/src/buttons/bundle.ts]
src_main_script[main/src/main/script.js]
src_main_style[main/src/main/style.scss]src_buttons_colored -.-> src_buttons_bundle
src_buttons_sized -.-> src_buttons_bundle
endsubgraph dest[static]
dest_buttons_bundle[buttons/static/buttons/bundle.js]
dest_main_script[main/static/main/script.js]
dest_main_style[main/static/main/style.css]
endsrc_buttons_bundle --> dest_buttons_bundle
src_main_script --> dest_main_script
src_main_style --> dest_main_style
```