diff --git a/examples/templates/example.html b/examples/templates/example.html index 4d6116fae6..164da44fdb 100644 --- a/examples/templates/example.html +++ b/examples/templates/example.html @@ -1,5 +1,5 @@ - +
diff --git a/site/build.js b/site/build.js index 8d9d42a323..7c31ee6a05 100644 --- a/site/build.js +++ b/site/build.js @@ -1,10 +1,14 @@ import Metalsmith from 'metalsmith'; +import common from '@rollup/plugin-commonjs'; import inPlace from '@metalsmith/in-place'; import layouts from '@metalsmith/layouts'; import markdown from '@metalsmith/markdown'; -import {dirname} from 'node:path'; +import {dirname, resolve} from 'node:path'; import {env} from 'node:process'; import {fileURLToPath} from 'node:url'; +import {nodeResolve} from '@rollup/plugin-node-resolve'; +import {rollup} from 'rollup'; +import {terser} from 'rollup-plugin-terser'; const baseDir = dirname(fileURLToPath(import.meta.url)); @@ -19,8 +23,34 @@ const builder = Metalsmith(baseDir) .use(markdown()) .use(layouts()); -builder.build((err) => { +builder.build(async (err) => { if (err) { throw err; } + await bundleMain(); }); + +async function bundleMain() { + const inputOptions = { + plugins: [ + common(), + nodeResolve({ + moduleDirectories: [ + resolve(baseDir, '../src'), + resolve(baseDir, '../node_modules'), + ], + }), + terser(), + ], + input: resolve(baseDir, './build/main.js'), + }; + + const outputOptions = { + dir: resolve(baseDir, './build'), + format: 'iife', + }; + + const bundle = await rollup(inputOptions); + await bundle.write(outputOptions); + bundle.close(); +} diff --git a/site/layouts/default.hbs b/site/layouts/default.hbs index 706c4c989d..2614b50f83 100644 --- a/site/layouts/default.hbs +++ b/site/layouts/default.hbs @@ -1,6 +1,7 @@ - + +
+
Pull tiles from OSM, Bing, MapBox, Stamen, and any other XYZ source you can find. OGC mapping services and untiled layers also supported.
+
Render vector data from GeoJSON, TopoJSON, KML, GML, Mapbox vector tiles, and other formats.
+
Leverages Canvas 2D, WebGL, and all the latest greatness from HTML5. Mobile support out of the box. Build lightweight custom profiles with just the components you need.
+
Style your map controls with straight-forward CSS. Hook into different levels of the API or use 3rd party libraries to customize and extend functionality.