Skip to content

Commit

Permalink
Merge pull request #1221 from IgniteUI/mvenkov/fix-react-build
Browse files Browse the repository at this point in the history
  • Loading branch information
Lipata authored Mar 12, 2024
2 parents c035921 + f355c7a commit f956b89
Show file tree
Hide file tree
Showing 10 changed files with 73 additions and 56 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Editor configuration, see https://editorconfig.org
root = true

[*]
charset = utf-8
indent_style = space
indent_size = 2
insert_final_newline = true
trim_trailing_whitespace = true

[*.ts]
quote_type = single

[*.md]
max_line_length = off
trim_trailing_whitespace = false
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
{
"version": "$(cliVersion)",
"project": {
"defaultPort": 3003,
"framework": "react",
"projectType": "igr-ts",
"projectTemplate": "$(projectTemplate)",
"theme": "$(theme)",
"isBundle": false,
"components": [],
"sourceFiles": [],
"isShowcase": false,
"version": ""
},
"build": {}
"version": "$(cliVersion)",
"project": {
"defaultPort": 3003,
"framework": "react",
"projectType": "igr-ts",
"projectTemplate": "$(projectTemplate)",
"theme": "$(theme)",
"isBundle": false,
"components": [],
"sourceFiles": [],
"isShowcase": false,
"version": ""
},
"build": {}
}
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@
"devDependencies": {
"@types/react": "^18.2.15",
"@types/react-dom": "^18.2.7",
"@vitejs/plugin-react": "^4.0.3",
"@typescript-eslint/eslint-plugin": "^6.2.1",
"@typescript-eslint/parser": "^6.2.1",
"@vitejs/plugin-react": "^4.0.3",
"eslint": "^8.46.0",
"eslint-plugin-react-hooks": "^4.6.0",
"eslint-plugin-react-refresh": "^0.4.3",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ import { render } from '@testing-library/react';
import App from './app';

test('renders without crashing', () => {
const wrapper = render(<App />);
expect(wrapper).toBeTruthy();
const wrapper = render(<App />);
expect(wrapper).toBeTruthy();
});
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@ import { Outlet } from "react-router-dom";

export default function App() {

return (
<div className="app">
<div className="content">
<Outlet />
</div>
</div>
)
return (
<div className="app">
<div className="content">
<Outlet />
</div>
</div>
)
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
* @param styles Object map of classes and their scoped name, normally from a CSS Module import
*/
export default function createClassTransformer(styles: any) {
return (classes: string) => {
return classes
.split(' ')
.map(className => styles[className] || className)
.join(' ');
}
return (classes: string) => {
return classes
.split(' ')
.map(className => styles[className] || className)
.join(' ');
}
}
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import React from 'react';
import ReactDOM from 'react-dom/client';
import { createBrowserRouter, RouterProvider } from "react-router-dom";
import { routes } from "./app/app-routes";
import App from './app/app';
import { routes } from "./app/app-routes";
import 'react-app-polyfill/ie11';

/** Required in IE11 for Charts */
Expand All @@ -11,14 +11,14 @@ Number.isNaN = Number.isNaN || function(value) {
}

const router = createBrowserRouter([
{
element: <App />,
children: [...routes]
}
{
element: <App />,
children: [...routes]
}
]);

ReactDOM.createRoot(document.getElementById('root')).render(
<React.StrictMode>
<RouterProvider router={router} />
</React.StrictMode>
<React.StrictMode>
<RouterProvider router={router} />
</React.StrictMode>
)
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/// <reference types="vite/client" />
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"lib": ["ES2020", "DOM", "DOM.Iterable"],
"module": "ESNext",
"skipLibCheck": true,
"composite": true,
"composite": true,
"allowSyntheticDefaultImports": true,

/* Bundler mode */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,21 @@ import react from '@vitejs/plugin-react'

// https://vitejs.dev/config/
export default defineConfig({
define: process.env.VITEST ? {} : { global: 'window' },
plugins: [react()],
test: {
globals: true,
environment: 'jsdom',
setupFiles: ['./src/setupTests.ts'],
deps: {
inline: ['vitest-canvas-mock'],
},
},
resolve: {
mainFields: ['module'],
},
server: {
open: true,
port: 3003
}
define: process.env.VITEST ? {} : { global: 'window' },
plugins: [react()],
test: {
globals: true,
environment: 'jsdom',
setupFiles: ['./src/setupTests.ts'],
deps: {
inline: ['vitest-canvas-mock'],
},
},
resolve: {
mainFields: ['module'],
},
server: {
open: true,
port: 3003
}
})

0 comments on commit f956b89

Please sign in to comment.