tauri-docs icon indicating copy to clipboard operation
tauri-docs copied to clipboard

Add guide: Tauri + Rollup

Open JonasKruckenberg opened this issue 3 years ago • 1 comments

Setup

  • link to rollup setup
  • link to tauri setup
  • add tauri to rollup project
  • consider using babel with recommend target config
    "targets": {
         "esmodules": true
         "chrome": "97",
         "safari": "13"
    }
    

Development

  • link to React, Vue, Svelte guides

Building

  • explain rollup -c (short)
  • explain how tauri build will find the assets

SSR

  • how? Maybe https://github.com/chrisvfritz/prerender-spa-plugin is an option?

Plugin recommendations

  • rollup is the sum of it's plugins
  • recommend some good plugins to use when developing native apps
    • rollup-plugin-visualizer, rollup-plugin-sizes or rollup-plugin-size-snapshot for tracking app size
    • rollup-plugin-terser - Minify code
    • rollup-plugin-serve - Development server
    • @rollup/plugin-node-resolve to bundle all node_module dependencies
    • @rollup/plugin-typescript just use typescript please
    • @rollup/plugin-replace to make use of TAURI_PLATFORM, TAURI_ARCH, TAURI_FAMILY, TAURI_PLATFORM_VERSION, TAURI_PLATFORM_TYPE and TAURI_DEBUG env variables
    • rollup-plugin-imagetools (shameless plug) or rollup-plugin-imagemin to optimize images

JonasKruckenberg avatar Feb 13 '22 21:02 JonasKruckenberg

Could this perhaps be taken up as a Frontend Configuration? https://beta.tauri.app/guides/frontend/ Tracking for 2.0

simonhyll avatar Sep 15 '23 21:09 simonhyll