Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
A
archivarius
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Andrey Kuvshinov
archivarius
Commits
9d21232e
Commit
9d21232e
authored
Oct 06, 2024
by
AK
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add frontend
parent
10d6816c
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
182 additions
and
9 deletions
+182
-9
.gitignore
.gitignore
+33
-9
main.js
frontend/main.js
+44
-0
package.json
frontend/package.json
+22
-0
removeQueryParams.js
frontend/removeQueryParams.js
+30
-0
vite.config.js
frontend/vite.config.js
+53
-0
No files found.
.gitignore
View file @
9d21232e
...
...
@@ -21,17 +21,41 @@ data/logs/*
vendor/*
# Node modules (if you're using npm or yarn for frontend dependencies)
node_modules/*
# IDE and editor files
*.iml
*.ipynb
*.swp
*.vscode
*.idea
frontend/node_modules/*
# Other files that shouldn't be tracked
*.bak
*.old
*.orig
*.tmp
\ No newline at end of file
*.tmp
# Build and compiled files
/.vite
dist/
build/
*.min.css
*.min.js
*.map
# Cache and temporary files
.tmp
.cache
*.tmp
*.log
# IDE and editor files
.vscode/
.idea/
*.iml
*.ipynb
*.swp
*.swo
*.sublime-workspace
*.sublime-project
# OS-specific files
.DS_Store
Thumbs.db
ehthumbs.db
Desktop.ini
\ No newline at end of file
frontend/main.js
0 → 100755
View file @
9d21232e
//styles
import
'./styles/reset.css'
import
'./styles/main.css'
import
'./styles/header.css'
import
'./styles/slider.css'
import
'./styles/shoplist.css'
import
'./styles/product.css'
import
'./styles/addcart.css'
import
'./styles/header-cart.css'
//import './styles/language_switcher.css'
import
'./styles/gallery.css'
import
'./styles/footer.css'
import
'./styles/tour-filters.css'
//import './styles/noUi.css'
import
'./styles/slider-range.css'
//noUiSlider
//import noUiSlider from 'nouislider';
//import './frontend/styles/product-gallery.css'
//import './frontend/styles/valute.css'
import
'./js/langform.js'
//компоненты
import
'./components/details/details.css'
import
'./components/details/details.js'
import
'./components/product-gallery/product-gallery.css'
import
'./components/product-gallery/product-gallery.js'
import
'./components/burger/burger.css'
import
'./components/burger/burger.js'
//scripts
import
'./js/range.js'
import
'./js/slider.js'
import
'./js/gallery.js'
frontend/package.json
0 → 100644
View file @
9d21232e
{
"name"
:
"concierges-theme"
,
"private"
:
true
,
"version"
:
"0.0.0"
,
"type"
:
"module"
,
"scripts"
:
{
"dev"
:
"vite"
,
"build"
:
"vite build"
,
"preview"
:
"vite preview"
,
"postbuild"
:
"node removeQueryParams.js"
},
"devDependencies"
:
{
"autoprefixer"
:
"^10.4.19"
,
"cssnano"
:
"^7.0.1"
,
"postcss"
:
"^8.4.38"
,
"vite"
:
"^5.2.11"
},
"dependencies"
:
{
"nouislider"
:
"^15.8.1"
,
"reset-css"
:
"^5.0.2"
}
}
frontend/removeQueryParams.js
0 → 100644
View file @
9d21232e
import
{
readdir
,
lstatSync
,
renameSync
}
from
'fs'
;
import
{
join
,
basename
}
from
'path'
;
const
assetDirectory
=
'dist/assets'
;
// Укажите путь к папке, где нужно убрать часть имени файла начиная с знака ?
async
function
removeQueryParams
(
directory
)
{
readdir
(
directory
,
async
(
err
,
files
)
=>
{
if
(
err
)
{
console
.
error
(
'Error reading directory:'
,
err
);
return
;
}
for
(
const
file
of
files
)
{
const
filePath
=
join
(
directory
,
file
);
if
(
lstatSync
(
filePath
).
isDirectory
())
{
await
removeQueryParams
(
filePath
);
}
else
{
const
fileName
=
basename
(
filePath
);
const
newFileName
=
fileName
.
split
(
'?'
)[
0
];
// Убираем часть имени файла начиная с знака ?
if
(
fileName
!==
newFileName
)
{
renameSync
(
filePath
,
join
(
directory
,
newFileName
));
}
}
}
});
}
removeQueryParams
(
assetDirectory
);
frontend/vite.config.js
0 → 100755
View file @
9d21232e
/**
* View your website at your own local server.
* Example: if you're using WP-CLI then the common URL is: http://localhost:8080.
*
* http://localhost:5173 is serving Vite on development. Access this URL will show empty page.
*
*/
import
{
defineConfig
}
from
"vite"
;
import
{
resolve
}
from
'path'
;
export
default
defineConfig
({
plugins
:
[
{
handleHotUpdate
({
file
,
server
})
{
if
(
file
.
endsWith
(
'.php'
))
{
server
.
ws
.
send
({
type
:
'full-reload'
,
path
:
'*'
});
}
}
}
],
build
:
{
// emit manifest so PHP can find the hashed files
minify
:
true
,
manifest
:
false
,
chunkFileNames
:
'assets/[name].js'
,
cssCodeSplit
:
false
,
rollupOptions
:
{
input
:
{
main
:
resolve
(
__dirname
+
'/main.js'
)
},
output
:
{
// Используем параметры шаблонизации для добавления хеша к имени файла
entryFileNames
:
`assets/[name].js?v=[hash]`
,
chunkFileNames
:
`assets/[name].js?v=[hash]`
,
assetFileNames
:
`assets/[name].[ext]?v=[hash]`
,
}
}
},
server
:
{
// required to load scripts from custom host
cors
:
{
origin
:
"*"
},
// We need a strict port to match on PHP side.
// You can change it. But, please update it on your .env file to match the same port
strictPort
:
true
,
port
:
5173
},
});
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment