mirror of
https://github.com/naturalcrit/homebrewery.git
synced 2026-08-06 04:37:37 +00:00
Add @components aliases to vite config
And update all the files to point to that directory to use the alias.
This commit is contained in:
@@ -1,6 +1,6 @@
|
|||||||
import { createRoot } from 'react-dom/client';
|
import { createRoot } from 'react-dom/client';
|
||||||
import Admin from './admin.jsx';
|
import Admin from './admin.jsx';
|
||||||
import { bootstrapAnchorPositioningPolyfill } from '../components/anchorPositioningPolyfill.js';
|
import { bootstrapAnchorPositioningPolyfill } from '@components/anchorPositioningPolyfill.js';
|
||||||
|
|
||||||
const props = window.__INITIAL_PROPS__ || {};
|
const props = window.__INITIAL_PROPS__ || {};
|
||||||
|
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ import ErrorBar from './errorBar/errorBar.jsx';
|
|||||||
import ToolBar from './toolBar/toolBar.jsx';
|
import ToolBar from './toolBar/toolBar.jsx';
|
||||||
|
|
||||||
//TODO: move to the brew renderer
|
//TODO: move to the brew renderer
|
||||||
import RenderWarnings from '../../components/renderWarnings/renderWarnings.jsx';
|
import RenderWarnings from '@components/renderWarnings/renderWarnings.jsx';
|
||||||
import NotificationPopup from './notificationPopup/notificationPopup.jsx';
|
import NotificationPopup from './notificationPopup/notificationPopup.jsx';
|
||||||
import Frame from 'react-frame-component';
|
import Frame from 'react-frame-component';
|
||||||
import dedent from 'dedent';
|
import dedent from 'dedent';
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import './errorBar.less';
|
import './errorBar.less';
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
|
|
||||||
import Dialog from '../../../components/dialog.jsx';
|
import Dialog from '@components/dialog.jsx';
|
||||||
|
|
||||||
const DISMISS_BUTTON = <i className='fas fa-times dismiss' />;
|
const DISMISS_BUTTON = <i className='fas fa-times dismiss' />;
|
||||||
|
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ import React, { useEffect, useState } from 'react';
|
|||||||
import request from '../../utils/request-middleware.js';
|
import request from '../../utils/request-middleware.js';
|
||||||
import Markdown from '@shared/markdown.js';
|
import Markdown from '@shared/markdown.js';
|
||||||
|
|
||||||
import Dialog from '../../../components/dialog.jsx';
|
import Dialog from '@components/dialog.jsx';
|
||||||
|
|
||||||
const DISMISS_BUTTON = <i className='fas fa-times dismiss' />;
|
const DISMISS_BUTTON = <i className='fas fa-times dismiss' />;
|
||||||
|
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ import './toolBar.less';
|
|||||||
import React, { useState, useEffect } from 'react';
|
import React, { useState, useEffect } from 'react';
|
||||||
import _ from 'lodash';
|
import _ from 'lodash';
|
||||||
|
|
||||||
import { Anchored, AnchoredBox, AnchoredTrigger } from '../../../components/Anchored.jsx';
|
import { Anchored, AnchoredBox, AnchoredTrigger } from '@components/Anchored.jsx';
|
||||||
|
|
||||||
const MAX_ZOOM = 300;
|
const MAX_ZOOM = 300;
|
||||||
const MIN_ZOOM = 10;
|
const MIN_ZOOM = 10;
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import createReactClass from 'create-react-class';
|
|||||||
import _ from 'lodash';
|
import _ from 'lodash';
|
||||||
import dedent from 'dedent';
|
import dedent from 'dedent';
|
||||||
|
|
||||||
import CodeEditor from '../../components/codeEditor/codeEditor.jsx';
|
import CodeEditor from '@components/codeEditor/codeEditor.jsx';
|
||||||
import SnippetBar from './snippetbar/snippetbar.jsx';
|
import SnippetBar from './snippetbar/snippetbar.jsx';
|
||||||
import MetadataEditor from './metadataEditor/metadataEditor.jsx';
|
import MetadataEditor from './metadataEditor/metadataEditor.jsx';
|
||||||
|
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import React from 'react';
|
|||||||
import createReactClass from 'create-react-class';
|
import createReactClass from 'create-react-class';
|
||||||
import _ from 'lodash';
|
import _ from 'lodash';
|
||||||
import request from '../../utils/request-middleware.js';
|
import request from '../../utils/request-middleware.js';
|
||||||
import Combobox from '../../../components/combobox.jsx';
|
import Combobox from '@components/combobox.jsx';
|
||||||
import TagInput from '../tagInput/tagInput.jsx';
|
import TagInput from '../tagInput/tagInput.jsx';
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
import './snippetbar.less';
|
import './snippetbar.less';
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
import createReactClass from 'create-react-class';
|
import createReactClass from 'create-react-class';
|
||||||
import { Dropdown } from '../../../components/dropdown/dropdown.jsx';
|
import { Dropdown } from '@components/dropdown/dropdown.jsx';
|
||||||
|
|
||||||
import _ from 'lodash';
|
import _ from 'lodash';
|
||||||
import cx from 'classnames';
|
import cx from 'classnames';
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import './tagInput.less';
|
import './tagInput.less';
|
||||||
import React, { useState, useEffect } from 'react';
|
import React, { useState, useEffect } from 'react';
|
||||||
import Combobox from '../../../components/combobox.jsx';
|
import Combobox from '@components/combobox.jsx';
|
||||||
|
|
||||||
import { tagSuggestionList, canonizationList } from './curatedTagSuggestionList.js';
|
import { tagSuggestionList, canonizationList } from './curatedTagSuggestionList.js';
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import { createRoot } from 'react-dom/client';
|
import { createRoot } from 'react-dom/client';
|
||||||
import Homebrew from './homebrew.jsx';
|
import Homebrew from './homebrew.jsx';
|
||||||
import { bootstrapAnchorPositioningPolyfill } from '../components/anchorPositioningPolyfill.js';
|
import { bootstrapAnchorPositioningPolyfill } from '@components/anchorPositioningPolyfill.js';
|
||||||
|
|
||||||
const props = window.__INITIAL_PROPS__ || {};
|
const props = window.__INITIAL_PROPS__ || {};
|
||||||
|
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import createReactClass from 'create-react-class';
|
|||||||
import _ from 'lodash';
|
import _ from 'lodash';
|
||||||
import cx from 'classnames';
|
import cx from 'classnames';
|
||||||
|
|
||||||
import NaturalCritIcon from '../../components/svg/naturalcrit-d20.svg.jsx';
|
import NaturalCritIcon from '@components/svg/naturalcrit-d20.svg.jsx';
|
||||||
|
|
||||||
const Nav = {
|
const Nav = {
|
||||||
base : createReactClass({
|
base : createReactClass({
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import moment from 'moment';
|
import moment from 'moment';
|
||||||
import UIPage from '../basePages/uiPage/uiPage.jsx';
|
import UIPage from '../basePages/uiPage/uiPage.jsx';
|
||||||
import NaturalCritIcon from '../../../components/svg/naturalcrit-d20.svg.jsx';
|
import NaturalCritIcon from '@components/svg/naturalcrit-d20.svg.jsx';
|
||||||
|
|
||||||
let SAVEKEY = '';
|
let SAVEKEY = '';
|
||||||
|
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ import _ from 'lodash';
|
|||||||
import { DEFAULT_BREW_LOAD } from '../../../../server/brewDefaults.js';
|
import { DEFAULT_BREW_LOAD } from '../../../../server/brewDefaults.js';
|
||||||
import { printCurrentBrew, fetchThemeBundle } from '@shared/helpers.js';
|
import { printCurrentBrew, fetchThemeBundle } from '@shared/helpers.js';
|
||||||
|
|
||||||
import SplitPane from '../../../components/splitPane/splitPane.jsx';
|
import SplitPane from '@components/splitPane/splitPane.jsx';
|
||||||
import Editor from '../../editor/editor.jsx';
|
import Editor from '../../editor/editor.jsx';
|
||||||
import BrewRenderer from '../../brewRenderer/brewRenderer.jsx';
|
import BrewRenderer from '../../brewRenderer/brewRenderer.jsx';
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import './lockNotification.less';
|
import './lockNotification.less';
|
||||||
import * as React from 'react';
|
import * as React from 'react';
|
||||||
import request from '../../../utils/request-middleware.js';
|
import request from '../../../utils/request-middleware.js';
|
||||||
import Dialog from '../../../../components/dialog.jsx';
|
import Dialog from '@components/dialog.jsx';
|
||||||
|
|
||||||
function LockNotification(props) {
|
function LockNotification(props) {
|
||||||
props = {
|
props = {
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ import _ from 'lodash';
|
|||||||
import { DEFAULT_BREW } from '../../../../server/brewDefaults.js';
|
import { DEFAULT_BREW } from '../../../../server/brewDefaults.js';
|
||||||
import { printCurrentBrew, fetchThemeBundle } from '@shared/helpers.js';
|
import { printCurrentBrew, fetchThemeBundle } from '@shared/helpers.js';
|
||||||
|
|
||||||
import SplitPane from '../../../components/splitPane/splitPane.jsx';
|
import SplitPane from '@components/splitPane/splitPane.jsx';
|
||||||
import Editor from '../../editor/editor.jsx';
|
import Editor from '../../editor/editor.jsx';
|
||||||
import BrewRenderer from '../../brewRenderer/brewRenderer.jsx';
|
import BrewRenderer from '../../brewRenderer/brewRenderer.jsx';
|
||||||
|
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ import _ from 'lodash';
|
|||||||
import { DEFAULT_BREW } from '../../../../server/brewDefaults.js';
|
import { DEFAULT_BREW } from '../../../../server/brewDefaults.js';
|
||||||
import { printCurrentBrew, fetchThemeBundle, splitTextStyleAndMetadata } from '@shared/helpers.js';
|
import { printCurrentBrew, fetchThemeBundle, splitTextStyleAndMetadata } from '@shared/helpers.js';
|
||||||
|
|
||||||
import SplitPane from '../../../components/splitPane/splitPane.jsx';
|
import SplitPane from '@components/splitPane/splitPane.jsx';
|
||||||
import Editor from '../../editor/editor.jsx';
|
import Editor from '../../editor/editor.jsx';
|
||||||
import BrewRenderer from '../../brewRenderer/brewRenderer.jsx';
|
import BrewRenderer from '../../brewRenderer/brewRenderer.jsx';
|
||||||
|
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ import Account from '@navbar/account.navitem.jsx';
|
|||||||
import NewBrew from '@navbar/newbrew.navitem.jsx';
|
import NewBrew from '@navbar/newbrew.navitem.jsx';
|
||||||
import HelpNavItem from '@navbar/help.navitem.jsx';
|
import HelpNavItem from '@navbar/help.navitem.jsx';
|
||||||
import BrewItem from '../basePages/listPage/brewItem/brewItem.jsx';
|
import BrewItem from '../basePages/listPage/brewItem/brewItem.jsx';
|
||||||
import SplitPane from '../../../components/splitPane/splitPane.jsx';
|
import SplitPane from '@components/splitPane/splitPane.jsx';
|
||||||
import ErrorIndex from '../errorPage/errors/errorIndex.js';
|
import ErrorIndex from '../errorPage/errors/errorIndex.js';
|
||||||
|
|
||||||
import request from '../../utils/request-middleware.js';
|
import request from '../../utils/request-middleware.js';
|
||||||
|
|||||||
@@ -13,6 +13,7 @@ export default defineConfig({
|
|||||||
'@sharedStyles' : path.resolve(__dirname, './shared/naturalcrit/styles'),
|
'@sharedStyles' : path.resolve(__dirname, './shared/naturalcrit/styles'),
|
||||||
'@navbar' : path.resolve(__dirname, './client/homebrew/navbar'),
|
'@navbar' : path.resolve(__dirname, './client/homebrew/navbar'),
|
||||||
'@themes' : path.resolve(__dirname, './themes'),
|
'@themes' : path.resolve(__dirname, './themes'),
|
||||||
|
'@components' : path.resolve(__dirname, './client/components')
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
build : {
|
build : {
|
||||||
|
|||||||
Reference in New Issue
Block a user