Giter Club home page Giter Club logo

ionic-simplevitejs's Introduction

Simple Ionic 6 + ViteJS app

This repository contains a simple React application that uses ViteJS template and Ionic 6 (RC2). It demonstrates issue with vite serve (as of November 16, 2021).

Creation steps

I tried to stay as close to the original ViteJS template as possible:

# use ViteJS's "react-ts" template
cd /work/directory
yarn create vite ionic-simplevitejs --template react-ts

# add Ionic 6 RC2
cd ./ionic-simplevitejs
yarn && yarn add --dev @ionic/react@next

# open in editor
# - add "Hello World" page to "App.tsx"
# - remove unused files
# - simplify "main.tsx"
# - fix TypeScript build issue ("skipLibCheck" in "tsconfig.json")
code .

Development mode

When running the web application in development mode, everything works as expected:

# start ViteJS development server
yarn dev

The DOM contains all the Ionic elements, as expected:

DOM for "vite dev"

Production mode

However, when I run the web application in production mode (ViteJS's preview), the page is not rendered correctly:

# build distribution files and start ViteJS preview server
yarn build && yarn serve

The DOM explains why the page doesn't look right -- all ion-... elements are replaced with tagname elements, and shadow DOM nodes are missing:

DOM for "vite serve"

ionic-simplevitejs's People

Contributors

milang avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.