Function createConfig

  • An opinionated outer config wrapper for vite (layers upon layers!!). To prevent having unique & complex config setups across multiple similar projects. This handles index minification, css, scss, preact, pwa, service worker etc and the fact they can't come from a separate CDN. Designed to work with a custom index.html file.

    CSS:

    • css/scss is handled automatically, postcss.config.cjs is being detected automatically
    • foo.module.s?css identifies local, everything else is treated as global
    • (for potential future compatibility still globals as write as foo.global.s?css)

    HTML ENTRY:

    • Vite looks for an index.html file at the root, there's currently no way to configure this.
    • If you need to preprocess in any way, e.g. django or etch. You'll have to have a source you preprocess first before running vite, writing it to root/index.html.
    • Vite will process it further
    • The final minified index.html will be added to the assets folder, where it should be the root of a static site, or server manually from a backend server.

    Parameters

    Returns UserConfig

Generated using TypeDoc