Last active
April 12, 2017 04:15
-
-
Save jschr/e46c4b87f008bb4f654b062996a2cdac to your computer and use it in GitHub Desktop.
Basic webpack config for static site generator
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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