@open-xchange/vite-plugin-ox-manifests 0.4.4 → 0.4.5
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/package.json
CHANGED
|
@@ -2,7 +2,12 @@ import { PROJECT_NAME as name } from '../constants.js'
|
|
|
2
2
|
import MagicString from 'magic-string'
|
|
3
3
|
|
|
4
4
|
export default function ({ transformAbsolutePaths } = {}) {
|
|
5
|
+
let resolvedConfig
|
|
5
6
|
return {
|
|
7
|
+
configResolved (config) {
|
|
8
|
+
resolvedConfig = config
|
|
9
|
+
},
|
|
10
|
+
|
|
6
11
|
transform (code, id) {
|
|
7
12
|
if (id === 'vite/preload-helper') {
|
|
8
13
|
// 2.5.2 transformation
|
|
@@ -22,6 +27,7 @@ export default function ({ transformAbsolutePaths } = {}) {
|
|
|
22
27
|
|
|
23
28
|
transformIndexHtml (src) {
|
|
24
29
|
if (!transformAbsolutePaths) return src
|
|
30
|
+
if (resolvedConfig.mode !== 'production') return src
|
|
25
31
|
|
|
26
32
|
return src
|
|
27
33
|
.replace(/(<link[^>]*href="?)(\/)/g, '$1.$2')
|