// webpack.config.jsconstrouteDataMapper=require('webpack-route-data-mapper');constsharePageData={a: {title: 'share page A'},b: {title: 'share page A'}};module.exports={/* (your loader settings) */plugins: [routeDataMapper({baseDir: `./src/pug/page`,src: '**/[!_]*.pug',// template base locals datalocals: {url: 'example site'},// mapping template name for html pathroutes: {'/share/:shares': 'share.pug'},// data for each routingdata: {shares: sharePageData},})]};// => will generate `/share/a/index.html` and `/share/b/index.html`