Skip to content

Commit

Permalink
🐛 Fix HMR issue 2
Browse files Browse the repository at this point in the history
  • Loading branch information
alexandre-mb-airweb committed Nov 23, 2020
1 parent 6b21776 commit ab27288
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@amoutonbrady/vite-plugin-solid",
"version": "0.4.1",
"version": "0.4.2",
"description": "solid-js integration plugin for vite",
"main": "lib/plugin.js",
"publishConfig": {
Expand Down
6 changes: 3 additions & 3 deletions src/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,15 @@ export function solidPlugin(options?: SolidPluginOptions): Plugin {
presets: babelPresets,
plugins: babelPlugins,
babelHelpers: "bundled",
extensions: [".js", ".ts", ".jsx", ".tsx"],
extensions: [".jsx", ".tsx"],
...(babelOptions || babel),
} as RollupBabelInputPluginOptions),
],
},
configureServer: ({ resolver, app }) => {
app.use(async (ctx, next) => {
// Intercept the current request to the dev server and check if it's a js/ts/jsx/tsx file
if (/\.(t|j)sx?$/.test(ctx.path)) {
// Intercept the current request to the dev server and check if it's a jsx/tsx file
if (/\.(t|j)sx$/.test(ctx.path)) {
// Retrieve the requested file and transform it on the fly with babel
const result = await transformFileAsync(
resolver.requestToFile(ctx.path),
Expand Down

0 comments on commit ab27288

Please sign in to comment.