add minimal TS bundler
This commit is contained in:
@@ -1,16 +0,0 @@
|
||||
/** @type {import('maplibre-gl')} */
|
||||
const maplibregl = window.maplibregl;
|
||||
|
||||
var map = new maplibregl.Map({
|
||||
container: "map",
|
||||
style:
|
||||
"https://api.maptiler.com/maps/019be805-c88e-7c8b-9850-bc704d72e604/style.json?key=8nmgHEIZQiIgqQj3RZNa",
|
||||
center: [-74.5, 40],
|
||||
zoom: 9,
|
||||
});
|
||||
|
||||
map.on("load", () => {
|
||||
navigator.geolocation.getCurrentPosition((position) => {
|
||||
// map.panTo(...)
|
||||
});
|
||||
});
|
||||
3
frontend/static/frontend/ts/lib/add.ts
Normal file
3
frontend/static/frontend/ts/lib/add.ts
Normal file
@@ -0,0 +1,3 @@
|
||||
export default function add(a: number, b: number): number {
|
||||
return a + b;
|
||||
}
|
||||
3
frontend/static/frontend/ts/main.ts
Normal file
3
frontend/static/frontend/ts/main.ts
Normal file
@@ -0,0 +1,3 @@
|
||||
import add from "./lib/add";
|
||||
|
||||
console.log(add(1, 2));
|
||||
@@ -9,5 +9,5 @@
|
||||
{% endblock %}
|
||||
|
||||
{% block js_bottom %}
|
||||
<script src="{% static 'frontend/js/home.js' %}"></script>
|
||||
<script src="{% static 'frontend/dist/main.js' %}"></script>
|
||||
{% endblock %}
|
||||
|
||||
Reference in New Issue
Block a user