Skip to content

Commit 13beef1

Browse files
committed
add rollup for maplibre
1 parent 3b48565 commit 13beef1

File tree

4 files changed

+16
-4
lines changed

4 files changed

+16
-4
lines changed

Makefile

+1
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,7 @@ govukAssets::
110110
npx nps copy.govukAssets
111111

112112
javascripts:
113+
npm run build
113114
rsync -r assets/javascripts static/
114115

115116
robots:

application/templates/national-map.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
%}
1515

1616
{%- block mapAssets %}
17-
<script src='https://unpkg.com/maplibre-gl@latest/dist/maplibre-gl.js'></script>
17+
<script src='/static/javascripts/maplibre-gl.js'></script>
1818
<link href='https://unpkg.com/maplibre-gl@latest/dist/maplibre-gl.css' rel='stylesheet' />
1919
{{ super() }}
2020
{% endblock -%}

package.json

+4-3
Original file line numberDiff line numberDiff line change
@@ -31,13 +31,14 @@
3131
"test": "vitest run",
3232
"coverage": "vitest run --coverage",
3333
"test-unit": "vitest run --dir tests/unit/javascript",
34-
"test-integration": "vitest run --dir tests/integration/javascript"
34+
"test-integration": "vitest run --dir tests/integration/javascript",
35+
"build": "rollup -c"
3536
},
3637
"dependencies": {
3738
"copyfiles": "^2.4.1",
3839
"govuk-frontend": "4.2.0",
39-
"node-sass": "^9.0.0",
40-
"nps": "^5.10.0"
40+
"maplibre-gl": "^4.1.2",
41+
"node-sass": "^9.0.0"
4142
},
4243
"devDependencies": {
4344
"@vitest/coverage-v8": "^0.34.1",

rollup.config.js

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
// get the config object from the package file
2+
module.exports = [
3+
{
4+
input: `./node_modules/maplibre-gl/dist/maplibre-gl.js`,
5+
output: {
6+
file: `static/javascripts/maplibre-gl.js`,
7+
format: "iife",
8+
}
9+
},
10+
];

0 commit comments

Comments
 (0)