mango-cms 0.2.13 → 0.2.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/default/package.json +3 -0
- package/default/vite.config.js +40 -23
- package/package.json +1 -1
package/default/package.json
CHANGED
package/default/vite.config.js
CHANGED
|
@@ -9,32 +9,49 @@ let configPath = path.resolve(projectRoot, 'mango')
|
|
|
9
9
|
|
|
10
10
|
// If config doesn't exist in current directory, check parent
|
|
11
11
|
if (!fs.existsSync(configPath)) {
|
|
12
|
-
|
|
13
|
-
|
|
12
|
+
projectRoot = path.resolve(projectRoot, '..')
|
|
13
|
+
configPath = path.resolve(projectRoot, 'mango')
|
|
14
14
|
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
15
|
+
// If config still doesn't exist, throw error
|
|
16
|
+
if (!fs.existsSync(configPath)) {
|
|
17
|
+
throw new Error('Mango folder not found. Please ensure your mango folder exists either in the current directory or parent directory.')
|
|
18
|
+
}
|
|
19
19
|
}
|
|
20
20
|
|
|
21
|
+
const collectionsPath = path.resolve(configPath, 'config/.collections.json')
|
|
22
|
+
|
|
21
23
|
// https://vitejs.dev/config/
|
|
22
24
|
export default defineConfig({
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
25
|
+
plugins: [
|
|
26
|
+
vue(),
|
|
27
|
+
{
|
|
28
|
+
name: 'watch-collections',
|
|
29
|
+
configureServer(server) {
|
|
30
|
+
server.watcher.add(collectionsPath)
|
|
31
|
+
server.watcher.on('change', (file) => {
|
|
32
|
+
if (file === collectionsPath) {
|
|
33
|
+
server.ws.send({
|
|
34
|
+
type: 'full-reload',
|
|
35
|
+
})
|
|
36
|
+
}
|
|
37
|
+
})
|
|
38
|
+
},
|
|
39
|
+
},
|
|
40
|
+
],
|
|
41
|
+
server: {
|
|
42
|
+
host: '0.0.0.0',
|
|
43
|
+
},
|
|
44
|
+
resolve: {
|
|
45
|
+
alias: {
|
|
46
|
+
'@config': configPath,
|
|
47
|
+
'@mango': configPath,
|
|
48
|
+
'@settings': path.resolve(configPath, 'config/settings.json'),
|
|
49
|
+
'@collections': path.resolve(configPath, 'config/.collections.json'),
|
|
50
|
+
'@plugins': path.resolve(configPath, 'plugins'),
|
|
51
|
+
vue: path.resolve(__dirname, 'node_modules/vue'),
|
|
52
|
+
},
|
|
53
|
+
},
|
|
54
|
+
optimizeDeps: {
|
|
55
|
+
exclude: ['vue', '@collections'], // Prevent Vite from optimizing Vue separately
|
|
56
|
+
},
|
|
40
57
|
})
|