[READ-ONLY] Mirror of https://github.com/probablykasper/svelte-template. Svelte + Vite + HMR + TypeScript + Preprocessor support
svelte template
0

Configure Feed

Select the types of activity you want to include in your feed.

Build `src` into `public/build`

Kasper (Jan 9, 2021, 7:30 AM +0100) 175c7c13 5db76a0e

+18 -7
+1 -1
.gitignore
··· 1 - /build/ 1 + /public/build/
+12 -1
README.md
··· 22 22 - `syler.sass-indented` for Sass 23 23 - `esbenp.prettier-vscode` for Prettier 24 24 25 + ## Config 26 + 27 + With this setup, `src/index.ts` is built and bundled into `public/build/`. If you want more entrypoints, add them to `experiments.optimize.entrypoints` in `snowpack.config.js`. 28 + 29 + If you want `src` and `public` to be built and copied to a folder like `dist`: 30 + 31 + 1. Change the properties `mount` and `buildOptions.out` in `snowpack.config.js` 32 + 2. Update `.gitignore` and the paths `public/index.html` 33 + 34 + To disable source maps/`.map` files for builds, disable `buildOptions.sourceMaps` in `snowpack.config.js`. 35 + 25 36 ## Commands 26 37 27 38 ### `npm run start` ··· 30 41 31 42 ### `npm run build` 32 43 33 - Builds and bundles into the `build/` folder 44 + Builds and bundles 34 45 35 46 ### `npm run lint` 36 47
+1 -1
package.json
··· 2 2 "private": true, 3 3 "scripts": { 4 4 "start": "snowpack dev", 5 - "build": "snowpack build --clean", 5 + "build": "snowpack build", 6 6 "lint": "prettier --write *.js *.json src public types" 7 7 }, 8 8 "devDependencies": {
+1 -1
public/index.html
··· 5 5 <meta name="viewport" content="width=device-width,initial-scale=1" /> 6 6 </head> 7 7 <body> 8 - <script type="module" src="/dist/index.js"></script> 8 + <script type="module" src="/build/index.js"></script> 9 9 </body> 10 10 </html>
+3 -3
snowpack.config.js
··· 1 1 /** @type {import("snowpack").SnowpackUserConfig } */ 2 2 module.exports = { 3 3 mount: { 4 - public: { url: '/', static: true }, 5 - src: { url: '/dist' }, 4 + src: { url: '/' }, 6 5 }, 7 6 plugins: ['@snowpack/plugin-svelte', '@snowpack/plugin-typescript'], 8 7 install: [], ··· 12 11 output: 'stream', // disable clearing of terminal 13 12 }, 14 13 buildOptions: { 15 - out: './build', 14 + out: './public/build', 16 15 sourceMaps: true, 17 16 }, 18 17 alias: {}, 19 18 experiments: { 20 19 optimize: { 20 + entrypoints: ['src/index.ts'], 21 21 bundle: true, 22 22 }, 23 23 },