Skip to content

Commit

Permalink
problems with bundler
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexNov03 committed Oct 19, 2024
1 parent b61f878 commit e1b95d9
Show file tree
Hide file tree
Showing 13 changed files with 87 additions and 272 deletions.
18 changes: 13 additions & 5 deletions dist/index.html
Original file line number Diff line number Diff line change
@@ -1,10 +1,18 @@
<!doctype html>
<html lang="en">

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta charset="utf-8">
<title>DEAD-VC.RU</title>
</head>
<meta name="viewport" content="width=device-width, initial-scale=1"><script defer src="bundle.js"></script><script defer src="bundle.js"></script></head>
<link rel="stylesheet" href="bundle.css">
<body>
<script src="main.js"></script>
<div class="place-for-header"></div>

<main class="main-content">
<div class="items-container"></div>
</main>
</body>
</html>


209 changes: 0 additions & 209 deletions dist/main.js

This file was deleted.

5 changes: 5 additions & 0 deletions eslint.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@ export default tseslint.config(
ignores: ['node_modules/*', 'dist/*', '.babelrc.cjs', 'webpack.config.cjs'],
},
{
env: {
browser: true, // Указывает, что код будет выполняться в браузерной среде
node: true, // Указывает, что код будет выполняться в среде Node.js
es6: true, // Указывает использование ES6 (ECMAScript 2015) синтаксиса
},
files: ['**/*.{ts,js}'],
plugins: {
prettier,
Expand Down
25 changes: 14 additions & 11 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 3 additions & 2 deletions src/components/Forms/forms.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import Navigator from '../../router/navigator.js';
import Ajax from '../../ajax/ajax.js';
import UserApi from '../../api/api_user.js';
import FormsTemplate from '../Forms/forms.hbs';

export default class Forms {
constructor(parent) {
Expand Down Expand Up @@ -31,8 +32,8 @@ export default class Forms {
render() {
const placeForHeader = document.querySelector('.place-for-header');
placeForHeader.innerHTML = '';
const template = Handlebars.templates['forms.hbs'];
this.parent.innerHTML = template({ context: this.context });
// const template = Handlebars.templates['forms.hbs'];
this.parent.innerHTML = FormsTemplate({ context: this.context });
const AuthForm = document.querySelector('.auth-form-inputs');

AuthForm.addEventListener('submit', this.handleSubmit.bind(this));
Expand Down
2 changes: 0 additions & 2 deletions src/components/Header/header.css
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
@import '/public/variables.css';

.header {
display: flex;
flex-direction: column;
Expand Down
8 changes: 5 additions & 3 deletions src/components/Header/header.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,18 @@ import Ajax from '../../ajax/ajax.js';
import UserState from '../../user/user.js';
import UserApi from '../../api/api_user.js';
import Navigator from '../../router/navigator.js';
import Handlebars from 'handlebars';
import HeaderTemplate from '../Header/header.hbs';
import styles from './header.css';

export default class Header {
constructor(parent) {
this.parent = parent;
}

render() {
const template = Handlebars.templates['header.hbs'];
this.parent.innerHTML = template({ user: UserState });

// const template = Handlebars.templates['header.hbs'];
this.parent.innerHTML = HeaderTemplate({ user: UserState });
if (UserState.isAuthorized) {
const logoutButton = document.querySelector('#logout-button');
logoutButton.addEventListener('click', (event) => {
Expand Down
1 change: 1 addition & 0 deletions src/d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
declare module '*.css';
2 changes: 2 additions & 0 deletions src/handlebars/helpers.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import Handlebars from 'handlebars';

export default function registerHelpers() {
Handlebars.registerHelper('isEqual', function (arg1, arg2) {
return arg1 === arg2;
Expand Down
Loading

0 comments on commit e1b95d9

Please sign in to comment.