Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Maplibre rollup hotfix #250

Merged
merged 2 commits into from
Apr 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ govukAssets::
npx nps copy.govukAssets

javascripts:
npm run build
rsync -r assets/javascripts static/

robots:
Expand All @@ -122,6 +123,7 @@ frontend:
make stylesheets
make govukAssets
rsync -r assets/images static/
cp node_modules/maplibre-gl/dist/maplibre-gl.css static/stylesheets/maplibre-gl.css

frontend-all: clean frontend

Expand Down
4 changes: 2 additions & 2 deletions application/templates/entity.html
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@
{% endblock %}

{%- block mapAssets %}
<script src='https://unpkg.com/maplibre-gl@latest/dist/maplibre-gl.js'></script>
<link href='https://unpkg.com/maplibre-gl@latest/dist/maplibre-gl.css' rel='stylesheet' />
<script src='/static/javascripts/maplibre-gl.js'></script>
<link href='/static/stylesheets/maplibre-gl.css' rel='stylesheet' />
<script src='https://api.mapbox.com/mapbox.js/plugins/turf/v2.0.2/turf.min.js'></script>
{{ super() }}
{% endblock -%}
Expand Down
4 changes: 2 additions & 2 deletions application/templates/national-map.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
%}

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

Expand Down
4 changes: 2 additions & 2 deletions application/templates/search.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
{% from 'components/pagination/macro.jinja' import appPagination %}

{%- block mapAssets %}
<script src='https://unpkg.com/maplibre-gl@latest/dist/maplibre-gl.js'></script>
<link href='https://unpkg.com/maplibre-gl@latest/dist/maplibre-gl.css' rel='stylesheet' />
<script src='/static/javascripts/maplibre-gl.js'></script>
<link href='/static/stylesheets/maplibre-gl.css' rel='stylesheet' />
<script src='https://api.mapbox.com/mapbox.js/plugins/turf/v2.0.2/turf.min.js'></script>
{{ super() }}
{% endblock -%}
Expand Down
7 changes: 4 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,14 @@
"test": "vitest run",
"coverage": "vitest run --coverage",
"test-unit": "vitest run --dir tests/unit/javascript",
"test-integration": "vitest run --dir tests/integration/javascript"
"test-integration": "vitest run --dir tests/integration/javascript",
"build": "rollup -c"
},
"dependencies": {
"copyfiles": "^2.4.1",
"govuk-frontend": "4.2.0",
"node-sass": "^9.0.0",
"nps": "^5.10.0"
"maplibre-gl": "^4.1.2",
"node-sass": "^9.0.0"
},
"devDependencies": {
"@vitest/coverage-v8": "^0.34.1",
Expand Down
10 changes: 10 additions & 0 deletions rollup.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
// get the config object from the package file
module.exports = [
{
input: `./node_modules/maplibre-gl/dist/maplibre-gl.js`,
output: {
file: `static/javascripts/maplibre-gl.js`,
format: "iife",
}
},
];
Loading