You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
1. Here we use `Tailwind CDN` to help user to do quick test, please remove it later.
211
-
2. We `load webpack_loader` at the top of the template
212
-
3. We can still use `static` tag to import image from the frontend project.
213
-
4. We use `stylesheet_pack` and `javascript_pack` to load CSS and JS bundle files to Django
222
+
1. We `load webpack_loader` at the top of the template
223
+
2. We can still use `static` tag to import image from the frontend project.
224
+
3. We use `stylesheet_pack` and `javascript_pack` to load CSS and JS bundle files to Django
214
225
215
226
!!! note
216
227
1. When your javascript and css files grow bigger and bigger, code splitting would be done automatically by Webpack.
@@ -220,6 +231,9 @@ Add `index.html` to the above `example/templates`
220
231
## Manual Test
221
232
222
233
```bash
234
+
# restart webpack to let Tailwind auto scan
235
+
$ npm run watch
236
+
223
237
$ python manage.py migrate
224
238
$ python manage.py runserver
225
239
```
@@ -233,7 +247,38 @@ dom ready
233
247
jumbotron.js:8 Jumbotron initialized for node: [object HTMLDivElement]
234
248
```
235
249
236
-
The source code can also be found in the [Examples](https://github.com/AccordBox/python-webpack-boilerplate/tree/master/examples/)
250
+
## Explicitly Specify Source Files
251
+
252
+
Even Tailwind 4 can AUTO scan all project files in the project directory, we still recommend to explicitly specify the source files to improve performance.
253
+
254
+
Below is an example of `frontend/src/styles/index.css`
255
+
256
+
```css
257
+
/*import tailwindcss and disable automatic source detection*/
0 commit comments