This template has been built specially for demonstration of cooperation between svelte, svelte-ssr and webpack to perform server side rendering requests. This is like sapper but not (🤷♀️).
1. Clone the repository
git clone https://github.com/gustarus/svelte-ssr-template-webpack.git
2. Step into the template folder
cd ./svelte-ssr-template-webpack
3. Install dependencies
If you are using nvm
, switch to desired node.js
version.
nvm install
Use npm
to install dependencies.
npm install
This command will launch webpack-dev-server
for client
and server
entry points and node.js
server to perform server side rendering requests.
npm start
This command will launch webpack
to build assets for client
and server
entry points.
npm run build
This command will launch only node.js
server to serve compiled with npm run build
assets.
npm run production
If you want to use different base path, pass base
argument to the command.
With the following command template will be served from localhost:3000/foo/
.
npm run production -- --base /foo/