Skip to content

Commit

Permalink
fix: vite was not compiling my modules properly
Browse files Browse the repository at this point in the history
This was super annoying to fix.
  • Loading branch information
vantaboard committed Oct 1, 2021
1 parent d3a36f9 commit 6951024
Show file tree
Hide file tree
Showing 8 changed files with 18 additions and 19 deletions.
9 changes: 5 additions & 4 deletions client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,19 +39,20 @@
"dependencies": {
"@lottiefiles/react-lottie-player": "^3.4.1",
"@mdx-js/react": "^1.6.22",
"@react-three/drei": "^7.9.0",
"@react-three/drei": "^7.12.5",
"@react-three/fiber": "^7.0.7",
"@types/react": "^17.0.21",
"@types/react-router-dom": "^5.1.9",
"@types/three": "^0.131.1",
"@types/three": "^0.132.1",
"esbuild": "^0.12.28",
"polished": "^4.1.3",
"prism-react-renderer": "^1.2.1",
"react": "^17.0.2",
"react-dom": "^17.0.2",
"react-router-dom": "^5.3.0",
"styled-components": "^5.3.1",
"three": "^0.132.2",
"vite-plugin-ssr": "^0.3.1"
"three": "^0.133.0",
"vite-plugin-ssr": "^0.3.1",
"vite-tsconfig-paths": "^3.3.14"
}
}
6 changes: 2 additions & 4 deletions client/src/App.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import Builder from 'components/Builder';
import React from 'react';
import { BrowserRouter, Link, Route, Switch } from 'react-router-dom';
import Builder from 'components/Builder';

// TODO: Add container with better margins
const App = () => (
export default () => (
<BrowserRouter>
<div>
<ul>
Expand All @@ -20,5 +20,3 @@ const App = () => (
</div>
</BrowserRouter>
);

export default App;
2 changes: 1 addition & 1 deletion client/src/components/Builder/index.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Canvas } from '@react-three/fiber';
import React from 'react';
import { Wrapper } from './styles';
import Workspace from 'components/Builder/Workspace';
import { Canvas } from '@react-three/fiber';

export default () => {
return (
Expand Down
8 changes: 3 additions & 5 deletions client/src/globalStyle.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
import { createGlobalStyle } from 'styled-components';
import * as tokens from 'style-dictionary-dist/variables';
import { createGlobalStyle } from 'styled-components';

const GlobalStyle = createGlobalStyle`
export default createGlobalStyle`
* {
font-family: ${tokens.TypographyFamilyBase};
border-radius: 0;
border: 0;
padding: 0;
margin: 0;
}
`;

export default GlobalStyle;
`;
2 changes: 1 addition & 1 deletion client/src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import GlobalStyle from 'globalStyle';
ReactDOM.render(
<React.StrictMode>
<GlobalStyle />
<App />
<App />
</React.StrictMode>,
document.getElementById('root')
);
6 changes: 3 additions & 3 deletions client/src/stories/Button.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Story, Meta } from '@storybook/react';
import React from 'react';
import { Meta, Story } from '@storybook/react';
import Button from 'components/Elements/Button';
import { ButtonProps } from 'components/Elements/Button/interface';
import React from 'react';
// Button.stories.ts | Button.stories.tsx

export default {
Expand All @@ -17,4 +17,4 @@ export const Primary = Template.bind({});
Primary.args = {
primary: true,
label: 'Button',
};
};
1 change: 1 addition & 0 deletions client/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"lib": ["dom", "dom.iterable", "esnext"],
"allowJs": true,
"outDir": "./dist/",
"rootDir": "./src",
"skipLibCheck": true,
"esModuleInterop": true,
"allowSyntheticDefaultImports": true,
Expand Down
3 changes: 2 additions & 1 deletion client/vite.config.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import reactRefresh from '@vitejs/plugin-react-refresh';
import { defineConfig } from 'vite';
import tsconfigPaths from 'vite-tsconfig-paths';

// https://vitejs.dev/config/
export default defineConfig({
plugins: [reactRefresh()],
plugins: [reactRefresh(), tsconfigPaths()],
});

0 comments on commit 6951024

Please sign in to comment.