Skip to content

brandonxiang/svelte-webpack-mpa

Repository files navigation

svelte-webpack-mpa

license

Boilerplate

This template is built for multi-page application(MPA). If you want to create a new project with SPA, see template-webpack or webpack_svelte.

Usage

To create a new project based on this template using degit:

npx degit brandonxiang/svelte-webpack-mpa svelte-app
cd svelte-app
yarn
# or
npm i

Your static files can be placed into public folder.

Development

yarn dev
# or
npm run dev

http://localhost:9000/page1.html is the first page. http://localhost:9000/page2.html is the second page.

Build

Because of the extremely small bundle size of Svelte App, the common chunk for multi-pages is unneccessary to build. Each page has its own js bundle, or you can change webpack config by yourself.

yarn build
# or
npm run build

Analyze

yarn analyze
# or
npm run analyze

Preprocess

Preprocess is the most interesting API of svelte. Therefore, svelte-preprocess is included in the project. Postcss is essential for autoprefixer. Other style preprocessers, like sass, could be setted by yourself.

How to integate with vscode?

OFFICAL INTEGRATIONS

Changelog

  • babel is not essential. So we remove babel-loader

LICENSE

MIT @brandonxiang