// webpack.config.js
const routeDataMapper = require('webpack-route-data-mapper');
const sharePageData = {
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 data
locals: {
url: 'example site'
},
// mapping template name for html path
routes: {
'/share/:shares': 'share.pug'
},
// data for each routing
data: {
shares: sharePageData
},
})
]
};
// => will generate `/share/a/index.html` and `/share/b/index.html`
-
Notifications
You must be signed in to change notification settings - Fork 0
fnobi/webpack-route-data-mapper
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
About
No description, website, or topics provided.
Resources
Stars
Watchers
Forks
Packages 0
No packages published