Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion vueManager/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
"type": "module",
"scripts": {
"dev": "vite",
"prebuild": "rimraf ../assets/components/minishop3/js/mgr/vue-dist/index*.min.js",
"clean:vue-dist": "rimraf ../assets/components/minishop3/js/mgr/vue-dist ../assets/components/minishop3/css/mgr/vue-dist",
"prebuild": "npm run clean:vue-dist",
"build": "vite build",
"preview": "vite preview",
"lint": "eslint . --fix",
Expand Down
7 changes: 6 additions & 1 deletion vueManager/vite.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,13 @@ import prefixSelector from 'postcss-prefix-selector'
import { defineConfig } from 'vite'
import vueDevTools from 'vite-plugin-vue-devtools'

// outDir is the repo root — never set emptyOutDir:true here.
// Orphan hashed chunks are removed by `npm run clean:vue-dist` (prebuild).
const output = {
dir: '../',
assetFileNames: 'assets/components/minishop3/css/mgr/vue-dist/[name].min[extname]', // css files
chunkFileNames: 'assets/components/minishop3/js/mgr/vue-dist/[name]-[hash].min.js', // js chunks (hash avoids stale cache)
entryFileNames: 'assets/components/minishop3/js/mgr/vue-dist/[name].min.js', // main js file (entry point)
entryFileNames: 'assets/components/minishop3/js/mgr/vue-dist/[name].min.js', // fixed entry names for MODX
}

const DevInput = {
Expand Down Expand Up @@ -130,6 +132,9 @@ export default defineConfig(({ command }) => {
// command === 'build'
return {
build: {
// Safe: outDir is '../' (repo root). Full wipe would delete the project.
// vue-dist dirs are cleaned by package.json prebuild → clean:vue-dist.
emptyOutDir: false,
rollupOptions: {
output,
input: ProdInput,
Expand Down