Skip to content

Commit

Permalink
feat: use vite as bundler (#3)
Browse files Browse the repository at this point in the history
  • Loading branch information
Raubzeug authored Dec 29, 2023
1 parent 288768b commit eaedda0
Show file tree
Hide file tree
Showing 14 changed files with 10,103 additions and 10,101 deletions.
4 changes: 1 addition & 3 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
build
dist
public
*.css
*.css.map
public
3 changes: 0 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,3 @@ yarn-error.log*

.cache

# this project uses scss, so automatically generated css files should be ignored
*.css
*.css.map
6 changes: 0 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,6 @@ cd my-project
npm run dev
```

# 🎨 Styles

This project is using SASS for styles, but Remix requires css in runtime.
So when `npm run dev` runs the first time, SASS will generate all css code for you. Please don't edit this automatic generated files.
SASS will watch for changes in your scss files and will regenerate css when it is essential.

# 📖 Learn More

This package includes scripts and configuration used by [Remix](https://remix.run/).\
Expand Down
10 changes: 5 additions & 5 deletions app/components/InfoButtons/InfoButtons.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import React from 'react';
import block from 'bem-cn-lite';
import {block} from '../../utils';
import {Button, Icon} from '@gravity-ui/uikit';
import {BookOpen, CopyTransparent, ListUl, LogoTelegram} from '@gravity-ui/icons';
import Figma from '~/components/icons/Figma';
import Storybook from '~/components/icons/Storybook';
import GitHub from '~/components/icons/GitHub';
import Figma from '../icons/Figma';
import Storybook from '../icons/Storybook';
import GitHub from '../icons/GitHub';

import './InfoButtons.css';
import './InfoButtons.scss';

const b = block('info-buttons');

Expand Down
4 changes: 2 additions & 2 deletions app/components/Wrapper/Wrapper.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import React from 'react';
import block from 'bem-cn-lite';
import {block} from '../../utils';
import {Button, Icon, Theme, ThemeProvider} from '@gravity-ui/uikit';
import {Moon, Sun} from '@gravity-ui/icons';

import './Wrapper.css';
import './Wrapper.scss';

const b = block('wrapper');

Expand Down
9 changes: 2 additions & 7 deletions app/root.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type {LinksFunction, MetaFunction} from '@remix-run/node';
import type {MetaFunction} from '@remix-run/node';
import {
Links,
LiveReload,
Expand All @@ -7,17 +7,12 @@ import {
Scripts,
ScrollRestoration as ScrollRestorationRemix,
} from '@remix-run/react';
import {cssBundleHref} from '@remix-run/css-bundle';
import {getInitialRootClassName} from '@gravity-ui/uikit';

import '~/styles/globals.css';
import './styles/globals.scss';
import '@gravity-ui/uikit/styles/fonts.css';
import '@gravity-ui/uikit/styles/styles.css';

export const links: LinksFunction = () => [
...(cssBundleHref ? [{rel: 'stylesheet', href: cssBundleHref}] : []),
];

export const meta: MetaFunction = () => [
{
charset: 'utf-8',
Expand Down
8 changes: 2 additions & 6 deletions app/routes/_index.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
import {InfoButtons} from '~/components/InfoButtons';
import {Wrapper} from '~/components/Wrapper';

// TODO: remove these imports
import '@gravity-ui/uikit/build/esm/components/Button/Button.css';
import '@gravity-ui/uikit/build/esm/components/Icon/Icon.css';
import {InfoButtons} from '../components/InfoButtons';
import {Wrapper} from '../components/Wrapper';

const Index = () => {
return (
Expand Down
4 changes: 4 additions & 0 deletions app/utils.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
// eslint-disable-next-line no-restricted-imports
import {withNaming} from '@bem-react/classname';

export const block = withNaming({e: '__', m: '_'});
2 changes: 1 addition & 1 deletion remix.env.d.ts → env.d.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
/// <reference types="@remix-run/dev" />
/// <reference types="vite/client" />
/// <reference types="@remix-run/node" />
Loading

0 comments on commit eaedda0

Please sign in to comment.