Skip to content

Commit

Permalink
Merge branch 'release/0.0.4' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
amoutonbrady committed Jul 21, 2020
2 parents 0f91383 + ed712b2 commit 1855560
Show file tree
Hide file tree
Showing 3 changed files with 231 additions and 218 deletions.
24 changes: 15 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,14 @@ A simple integration to run [solid-js](https://github.com/ryansolid/solid) with
- Support typescript (`.js .ts .jsx .tsx`) out of the box
- Support code splitting out of the box

# Quickstart
# Quickstart

You can use the [vite-template-solid](https://github.com/amoutonbrady/vite-template-solid) starter templates similar to CRA:

```bash
$ npx degit amoutonbrady/vite-plugin-solid/playground my-solid-project
$ cd my-solid-project
$ npm install
$ npx degit amoutonbrady/vite-template-solid/js#main my-project
$ cd my-project
$ npm install # or pnpm install or yarn install
$ npm run dev # starts dev-server with hot-module-reloading
$ npm run build # builds to /dist
```
Expand All @@ -40,7 +42,7 @@ Add it as plugin to `vite.config.ts`
```ts
// vite.config.ts
import { UserConfig } from "vite";
import { solidPlugin } from '@amoutonbrady/vite-plugin-solid';
import { solidPlugin } from "@amoutonbrady/vite-plugin-solid";

const config: UserConfig = {
root: "src",
Expand All @@ -59,7 +61,7 @@ Or `vite.config.js`

```js
// vite.config.js
import { solidPlugin } from '@amoutonbrady/vite-plugin-solid';
import { solidPlugin } from "@amoutonbrady/vite-plugin-solid";

/**
* @type {import('vite').UserConfig}
Expand All @@ -84,7 +86,7 @@ const rootEl = document.getElementById("app");
const dispose = render(() => App, rootEl);

// HMR stuff, this will be automatically removed during build
// /!\ You need to add "vite" in the "compilerOptions.types" of your tsconfig.json
// /!\ You need to add "vite" in the "compilerOptions.types" of your tsconfig.json
// if you want to avoid type errors here
if (import.meta.hot) {
import.meta.hot.accept();
Expand Down Expand Up @@ -113,11 +115,11 @@ Just use regular `vite` or `vite build` commands
You can pass options to the plugin via `vite.config.(js|ts)`

```js
import { solidPlugin } from '@amoutonbrady/vite-plugin-solid';
import { solidPlugin } from "@amoutonbrady/vite-plugin-solid";

const options = {
babel: {
presets: ['@babel/preset-env'],
presets: ["@babel/preset-env"],
},
};

Expand Down Expand Up @@ -147,6 +149,10 @@ This is an early version, some things may not work as expected. Please report fi
- ESBuild has to be deactivated because of its JSX management which slow downs a bit the reload
- Vite is primarly build for Vue and therefore includes it when installing it

# Troubleshooting

It appears that Webstorm generate some weird triggers when saving a file. In order to prevent that you can follow [this thread](https://intellij-support.jetbrains.com/hc/en-us/community/posts/360000154544-I-m-having-a-huge-problem-with-Webstorm-and-react-hot-loader-) and disable the **"Safe Write"** option in **"Settings | Appearance & Behavior | System Settings"**.

# Got a question? / Need help?

Join [solid discord](https://discord.com/invite/solidjs)
Expand Down
14 changes: 7 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@amoutonbrady/vite-plugin-solid",
"version": "0.0.3",
"version": "0.0.4",
"description": "solid-js integration plugin for vite",
"main": "lib/plugin.js",
"private": false,
Expand Down Expand Up @@ -37,15 +37,15 @@
"vite": "^1.0.0-beta.11 || ^1.0.0"
},
"dependencies": {
"@babel/core": "^7.10.4",
"@babel/core": "^7.10.5",
"@babel/preset-typescript": "^7.10.4",
"@rollup/plugin-babel": "^5.0.4",
"babel-preset-solid": "^0.18.12",
"solid-js": "^0.18.12",
"vite": "^1.0.0-beta.11"
"@rollup/plugin-babel": "^5.1.0",
"babel-preset-solid": "^0.18.14",
"solid-js": "^0.18.14",
"vite": "^1.0.0-rc.3"
},
"devDependencies": {
"@types/babel__core": "^7.1.9",
"typescript": "^4.0.0-dev.20200712"
"typescript": "^4.0.0-dev.20200721"
}
}
Loading

0 comments on commit 1855560

Please sign in to comment.