Svelte Webpack Template

This project is a starter kit for building app using Svelte and Webpack with easy setup and customization.

Features

  • dev server with live reload and error messages
  • minimal webpack setup
  • Handling static assets and various file formats
  • Checking for duplicate modules and packages in bundles
  • static serving scripts
  • easy to customize and update

Quick Start

git clone https://github.com/faraadi/svelte-webpack-template
cd svelte-webpack-template
npm install
npm start

open localhost:3000 in your browser.

Scripts

start - dev

packs and compile your code and run development server on port 3000 and watch for file changes.

build

build your application and make a optimized and minified version of your code and put it in dist directory.
all assets in public folder will be copied in dist directory.

Warning! all assets placed in dist, will be removed when running this script

serve

after running a successful build, you can run this script to preview a local version of your app.
run:

npm run build
npm run serve

then open localhost:5000

Customization

customization is straightforward and can be done through configuration files, placed in /configs directory.
you'll find two file:

  • webpack.config.dev.js - for development mode
  • webpack.config.prod.js - for production mode

Inspirations

  • template-webpack

    To Do

  • vendors and runtime code splitting
  • env support
  • env config files
  • Polyfills
  • ESLint support
  • Source Code Analyze Tool

    Author

  • Farhad Sharifi

License

This software is open sourced under MIT.

Top categories

svelte logo

Need a Svelte website built?

Hire a professional Svelte developer today.
Loading Svelte Themes