[READ-ONLY] Mirror of https://github.com/probablykasper/capacitor-svelte-snowpack-template.
capacitor svelte template
0

Configure Feed

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

Add `edge79`, `firefox62` and `safari11.1` to target

Kasper (Mar 11, 2021, 1:03 AM +0100) 0dfc684c 13a3ccb2

+24 -13
+6 -6
README.md
··· 3 3 Features: 4 4 5 5 - **Svelte** 6 + - **Snowpack** with **esbuild** enabled 6 7 - **TypeScript** 7 - - **Snowpack** for fast builds 8 - - **esbuild** enabled using `experiments.optimize` setting 9 - - **Preprocessor support** through `svelte-preprocess` 10 - - Pug and Sass are installed by default 8 + - **`svelte-preprocess` support** with Pug and Sass installed by default 11 9 - **Hot module replacement** 12 10 - **Prettier** 13 11 ··· 26 24 27 25 `src/main.ts` is built and bundled into `build/bundle/`. 28 26 29 - To disable source maps, disable `buildOptions.sourcemap` in `snowpack.config.js`. 30 - 31 27 ## Commands 32 28 33 29 ### `npm run start` ··· 41 37 ### `npm run lint` 42 38 43 39 Lint the project 40 + 41 + ### `npm run check` 42 + 43 + Run `svelte-check`
+3 -1
snowpack.config.js
··· 18 18 optimize: { 19 19 entrypoints: ['src/main.ts'], 20 20 bundle: true, 21 - target: ['chrome64', 'es2020'], 21 + minify: false, 22 + // using targets like es2019 and chrome63 causes warning (https://github.com/snowpackjs/snowpack/issues/2835) 23 + target: ['es2020', 'chrome64', 'edge79', 'firefox62', 'safari11.1'], 22 24 }, 23 25 }
+15 -6
src/main.ts
··· 7 7 export default app 8 8 9 9 // The code below enables HMR 10 - interface ImportMeta { 11 - [hot: string]: any 10 + declare global { 11 + interface ImportMeta { 12 + hot: { 13 + accept: Function 14 + dispose: Function 15 + } 16 + env: { 17 + MODE: string 18 + SNOWPACK_PUBLIC_API_URL: string 19 + SNOWPACK_PUBLIC_IMAGES_URL: string 20 + } 21 + } 12 22 } 13 - const meta: ImportMeta = import.meta 14 - if (meta.hot) { 15 - meta.hot.dispose(() => { 23 + if (import.meta.hot) { 24 + import.meta.hot.dispose(() => { 16 25 app.$destroy() 17 26 }) 18 - meta.hot.accept() 27 + import.meta.hot.accept() 19 28 }