@@ -303,29 +303,27 @@ See [Capacitor's Getting Started guide](https://capacitorjs.com/docs/getting-sta
303
303
304
304
## Build with TypeScript or JavaScript
305
305
306
- We love TypeScript at Ionic, and have believed for quite some time now that it’s a great tool for building scalable apps. That said, we know how much the Vue community values simplicity – in their tooling, languages, and more. In fact, it’s likely what drew you to Vue in the first place. Start simple – then scale up as needed.
306
+ Ionic Vue projects are created with TypeScript by default, but you can easily convert to JavaScript if you prefer. After generating a blank Ionic Vue app, follow these steps:
307
307
308
- So, if you’d prefer to use JavaScript instead of TypeScript, you can. After generating an Ionic Vue app, follow these steps:
309
-
310
- 1. Remove TypeScript dependencies:
308
+ 1. Remove the TypeScript dependencies:
311
309
312
310
```shell
313
311
npm uninstall --save typescript @types/jest @typescript-eslint/eslint-plugin @typescript-eslint/parser @vue/cli-plugin-typescript @vue/eslint-config-typescript vue-tsc
314
312
```
315
313
316
- 2. Change the extension of all `.ts` files to `.js`. In a blank Ionic Vue app, this will be the `src/router/index.ts`, `src/main.ts`, and all files in the `tests` directory.
314
+ 2. Change the extension of all `.ts` files to `.js`. In a blank Ionic Vue app, this will be the `src/router/index.ts`, `src/main.ts`, and files in the `tests` directory.
317
315
318
316
3. In `index.html`, change the imported `<script>` file from `/src/main.ts` to `/src/main.js`.
319
317
320
- 4. Remove `@vue/typescript/recommended` and `@typescript-eslint/no-explicit-any: ‘ off’, ` from `.eslintrc.js`.
318
+ 4. Remove `@vue/typescript/recommended` and `@typescript-eslint/no-explicit-any: ' off' ` from `.eslintrc.js`.
321
319
322
320
5. Remove `Array<RouteRecordRaw>` and the import of `RouteRecordRaw` from `src/router/index.js`.
323
321
324
322
6. Remove `lang="ts"` from the `script` tags in any of your Vue components that have them. In a blank Ionic Vue app, this should only be `src/App.vue` and `src/views/HomePage.vue`.
325
323
326
- 7. Delete `tsconfig.json` and `src/vite-env.d.ts`
324
+ 7. Delete `tsconfig.json` and `src/vite-env.d.ts`.
327
325
328
- 8. In package.json, change the build script from `"build": " vue-tsc && vite build" ` to `"build": " vite build" `
326
+ 8. In package.json, change the build script from `"build": " vue-tsc && vite build" ` to `"build": " vite build" `.
329
327
330
328
8. Install terser `npm i -D terser`.
331
329
0 commit comments