Skip to content

Commit

Permalink
Merge pull request #147 from keitaroinc/upgrade-to-react19
Browse files Browse the repository at this point in the history
Add vite config
  • Loading branch information
darkokeitaro authored Dec 20, 2024
2 parents 974d1b0 + 6beef89 commit babdff9
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 14 deletions.
26 changes: 13 additions & 13 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,21 @@ module.exports = {
root: true,
env: { browser: true, es2020: true },
extends: [
'eslint:recommended',
'plugin:react/recommended',
'plugin:react/jsx-runtime',
'plugin:react-hooks/recommended',
"eslint:recommended",
"plugin:react/recommended",
"plugin:react/jsx-runtime",
"plugin:react-hooks/recommended",
],
ignorePatterns: ['dist', '.eslintrc.cjs'],
parserOptions: { ecmaVersion: 'latest', sourceType: 'module' },
settings: { react: { version: '18.2' } },
plugins: ['eslint-plugin-react-compiler','react-refresh'],
ignorePatterns: ["dist", ".eslintrc.cjs"],
parserOptions: { ecmaVersion: "latest", sourceType: "module" },
settings: { react: { version: "18.2" } },
plugins: ["eslint-plugin-react-compiler", "react-refresh"],
rules: {
'react-compiler/react-compiler': "error",
'react/jsx-no-target-blank': 'off',
'react-refresh/only-export-components': [
'warn',
"react-compiler/react-compiler": "error",
"react/jsx-no-target-blank": "off",
"react-refresh/only-export-components": [
"warn",
{ allowConstantExport: true },
],
},
}
};
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"scripts": {
"dev": "vite",
"build": "vite build",
"lint": "eslint . --ext js,jsx --report-unused-disable-directives --max-warnings 0",
"lint": "npx prettier -cw . '!**/*.{png,txt,ico}'",
"preview": "vite preview",
"test": "jest"
},
Expand Down
4 changes: 4 additions & 0 deletions vite.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ const ReactCompilerConfig = {
};

export default defineConfig({
build: {
outDir: "build",
emptyOutDir: true, // also necessary
},
plugins: [
react({
babel: {
Expand Down

0 comments on commit babdff9

Please sign in to comment.