Skip to content

Commit 01d28d5

Browse files
chore: make use of Webpack for building CSS and JS files (#2127)
1 parent 57770f8 commit 01d28d5

12 files changed

+1968
-137
lines changed

bin/prepare_test_environment.sh

+1-3
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,7 @@ EOF
4848
if [ "$START_SERVER" = true ]; then
4949
cd /usr/src/app
5050

51-
npm install && \
52-
npm run coffee-build && \
53-
npm run sass-build
51+
npm install && npm run build
5452

5553
./manage.py makemigrations
5654
./manage.py migrate --fake-initial

bin/start_server.sh

+1-3
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,7 @@ fi
2727

2828
if [[ "$ENVIRONMENT" == "development" ]]; then
2929
echo "Starting Django development server..."
30-
npm install && \
31-
npm run coffee-build && \
32-
npm run sass-build
30+
npm install && npm run build
3331
./manage.py runserver 0.0.0.0:8080
3432
else
3533
echo "Generating Django static files..."

docker/Dockerfile.server.j2

+6-3
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,16 @@ RUN \
1010
RUN mkdir -p /app
1111
WORKDIR /app
1212

13-
COPY package.json package-lock.json /app
13+
COPY package.json \
14+
package-lock.json \
15+
webpack.prod.js \
16+
webpack.common.js \
17+
/app/
1418
RUN npm install
1519

1620
COPY ./static/js/*.coffee /app/static/js/
1721
COPY ./static/sass/*.scss /app/static/sass/
18-
RUN npm run coffee-build && \
19-
npm run sass-build
22+
RUN npm run build
2023

2124
{% endif %}
2225
{% include 'Dockerfile.base.j2' %}

docs/developer-documentation.md

+6-21
Original file line numberDiff line numberDiff line change
@@ -162,36 +162,21 @@ We've also provided a [checklist](/docs/qa-checklist.md) that can serve as a gui
162162
To get started, you need to start the development server first. See this [section](#dockerized-development-environment)
163163
for details.
164164

165-
### Installing Node.js dependencies
165+
### Starting Webpack in development mode
166166

167-
Run the following command from the project root directory.
167+
To start [Webpack](https://webpack.js.org/) in development mode, run the following command:
168168

169169
```bash
170170
$ docker compose -f docker-compose.dev.yml exec anthias-server \
171-
npm install
171+
npm run dev
172172
```
173173

174-
### Transpiling CSS from SASS
175-
176-
Open a new terminal session and run the following command:
177-
178-
```bash
179-
$ docker compose -f docker-compose.dev.yml exec anthias-server \
180-
npm run sass-dev
181-
```
182-
183-
### Transpiling JS from CoffeeScript
184-
185-
Open a new terminal session and run the following command:
186-
187-
```bash
188-
$ docker compose -f docker-compose.dev.yml exec anthias-server \
189-
npm run coffee-dev
190-
```
174+
Making changes to the CoffeeScript or SCSS files will automatically trigger a recompilation,
175+
generating the corresponding JavaScript and CSS files.
191176

192177
### Closing the transpiler
193178

194-
Just press `Ctrl-C` to close the SASS and CoffeeScript transpilers.
179+
Just press `Ctrl-C` to close Webpack in development mode.
195180

196181
## Linting Python code locally
197182

0 commit comments

Comments
 (0)