Skip to content

Instantly share code, notes, and snippets.

@jschr
Last active April 12, 2017 04:15
Show Gist options
  • Save jschr/e46c4b87f008bb4f654b062996a2cdac to your computer and use it in GitHub Desktop.
Save jschr/e46c4b87f008bb4f654b062996a2cdac to your computer and use it in GitHub Desktop.
Basic webpack config for static site generator
export default {
entry: {
// entry file for the app bundle and the sever-side
// render function
main: 'index.ts'
},
output: {
filename: `[name].js`,
path: 'build',
// required for static-site-generator-webpack-plugin
libraryTarget: 'umd'
},
...
plugins: [
new StaticSiteGeneratorPlugin({
// the paths to render
// we are only going to render the route path
// but supporting multiple routes should just work
paths: ['/'],
// additional data to pass to the ssr function
locals: {
username: 'jschr'
}
})
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment