Skip to content

Commit

Permalink
correcting project Types (#925)
Browse files Browse the repository at this point in the history
  • Loading branch information
Priyanshu-001 authored Oct 27, 2024
1 parent 6536286 commit 746c9a7
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 63 deletions.
Original file line number Diff line number Diff line change
@@ -1,57 +1,26 @@
import Tabs from '@theme/Tabs'
import TabItem from '@theme/TabItem'

## Create a project

Use your favorite package manager to scaffold a new project and follow the
prompts to create a vanilla JS project.

<Tabs groupId='vite-version'>
<TabItem value='vite2' label='Vite 2' default>

```sh
npm init vite@^2.9.4
```

</TabItem>
<TabItem value='vite3' label='Vite 3 (beta)'>

```sh
npm init vite@latest
```

:::info beta

CRXJS support for Vite 3 is in beta.

:::

:::info react users

HMR in CRXJS is incompatible with `@vite/plugin-react-swc`. We recommend using @vitejs/plugin-react instead.

:::

</TabItem>
</Tabs>

## Install CRXJS Vite plugin

Now install the CRXJS Vite plugin using your favorite package manager.

<Tabs groupId='vite-version'>
<TabItem value='vite2' label='Vite 2' default>

```sh
npm i @crxjs/vite-plugin@latest -D
```

</TabItem>
<TabItem value='vite3' label='Vite 3 (beta)'>

```sh
npm i @crxjs/vite-plugin@beta -D
```

</TabItem>
</Tabs>
import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';
import Admonition from '@theme/Admonition';

export const CreateProjectTabs = ({ projectType }) =>
<>
<p>Use your favorite package manager to scaffold a new project and follow the prompts to create a {projectType} project.</p>
<Tabs groupId='vite-version'>
<TabItem value='vite2' label='Vite 2' default>
<pre>
<code>npm init vite@^2.9.4</code>
</pre>
</TabItem>
<TabItem value='vite3' label='Vite 3 (beta)'>
<pre>
<code>npm init vite@latest</code>
</pre>
<Admonition type="info" title="beta">
CRXJS support for Vite 3 is in beta.
</Admonition>
<Admonition type="info" title="React Users">
HMR in CRXJS is incompatible with <code>@vite/plugin-react-swc</code>. We recommend using <code>@vitejs/plugin-react</code> instead.
</Admonition>
</TabItem>
</Tabs>
</>
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,15 @@ pagination_prev: null
slug: create-project
---

import CreateProjectTabs from '../\_create-project-tabs.mdx'
import {CreateProjectTabs} from '../\_create-project-tabs.mdx'

# Get Started with React

This quick guide will get you up and running with a Chrome Extension popup page.
You'll see how to integrate CRXJS with Vite, then explore Vite HMR in an
extension React HTML page. The first two sections take about 90 seconds!

<CreateProjectTabs />
<CreateProjectTabs projectType="react"/>

## Update the Vite config

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ tags:
pagination_prev: null
---

import CreateProjectTabs from '../\_create-project-tabs.mdx'
import {CreateProjectTabs} from '../\_create-project-tabs.mdx'

# Get Started with Vanilla JS

Expand All @@ -27,7 +27,7 @@ reload.

:::

<CreateProjectTabs />
<CreateProjectTabs projectType="vanilla JS"/>

## Create a Vite config file

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,15 @@ pagination_prev: null
slug: create-project
---

import CreateProjectTabs from '../\_create-project-tabs.mdx'
import {CreateProjectTabs} from '../\_create-project-tabs.mdx'

# Get Started with Vue

This quick guide will get you up and running with a Chrome Extension popup page.
You'll see how to integrate CRXJS with Vite, then explore Vite HMR in an
extension Vue HTML page. The first two sections take about 90 seconds!

<CreateProjectTabs />
<CreateProjectTabs projectType="vue"/>

:::tip package.json

Expand Down

0 comments on commit 746c9a7

Please sign in to comment.