bfg-common 1.1.25 → 1.1.27
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.
|
@@ -51,30 +51,48 @@ const npmGenerate = (): void => {
|
|
|
51
51
|
)
|
|
52
52
|
fs.cp(contentPath, publicPath, { recursive: true }, () => {
|
|
53
53
|
// Удаляем все файлы кроме картинок
|
|
54
|
+
console.log('removeNonImageFiles start');
|
|
54
55
|
removeNonImageFiles(publicPath)
|
|
56
|
+
console.log('removeNonImageFiles end');
|
|
55
57
|
|
|
56
58
|
// Удаляем картинки из папки content
|
|
59
|
+
console.log('removeImagesFromContent start');
|
|
57
60
|
removeImagesFromContent(contentPath)
|
|
61
|
+
console.log('removeImagesFromContent end');
|
|
58
62
|
|
|
59
63
|
// Правим путь к картинкам и заменяем кастомные тэги
|
|
64
|
+
console.log('updateImagesPathAndCustomComponents start');
|
|
60
65
|
updateImagesPathAndCustomComponents(contentPath)
|
|
66
|
+
console.log('updateImagesPathAndCustomComponents end');
|
|
61
67
|
})
|
|
62
68
|
// End block
|
|
63
69
|
}
|
|
64
70
|
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
case 'exec':
|
|
76
|
-
npmGenerate()
|
|
77
|
-
break
|
|
78
|
-
}
|
|
79
|
-
},
|
|
71
|
+
// @ts-ignore
|
|
72
|
+
export default defineNuxtModule(() => {
|
|
73
|
+
switch (process.env.npm_command) {
|
|
74
|
+
case 'run-script':
|
|
75
|
+
// npmDev()
|
|
76
|
+
break
|
|
77
|
+
case 'exec':
|
|
78
|
+
npmGenerate()
|
|
79
|
+
break
|
|
80
|
+
}
|
|
80
81
|
})
|
|
82
|
+
|
|
83
|
+
// export default defineNuxtModule({
|
|
84
|
+
// meta: {
|
|
85
|
+
// name: 'fix-content-build',
|
|
86
|
+
// configKey: 'fixContentBuild',
|
|
87
|
+
// },
|
|
88
|
+
// setup() {
|
|
89
|
+
// switch (process.env.npm_command) {
|
|
90
|
+
// case 'run-script':
|
|
91
|
+
// // npmDev()
|
|
92
|
+
// break
|
|
93
|
+
// case 'exec':
|
|
94
|
+
// npmGenerate()
|
|
95
|
+
// break
|
|
96
|
+
// }
|
|
97
|
+
// },
|
|
98
|
+
// })
|
|
@@ -91,11 +91,13 @@ export const replaceFileContent = async (
|
|
|
91
91
|
return new Promise((resolve, reject) => {
|
|
92
92
|
fs.readFile(filePath, 'utf8', (err: any, data: string) => {
|
|
93
93
|
if (err) {
|
|
94
|
+
console.log('replaceFileContent reject 1');
|
|
94
95
|
reject()
|
|
95
96
|
return console.log(err)
|
|
96
97
|
}
|
|
97
98
|
|
|
98
99
|
if (data.match(replacementString)) {
|
|
100
|
+
console.log('replaceFileContent, resolve 1');
|
|
99
101
|
resolve()
|
|
100
102
|
return
|
|
101
103
|
}
|
|
@@ -104,9 +106,11 @@ export const replaceFileContent = async (
|
|
|
104
106
|
|
|
105
107
|
fs.writeFile(filePath, updatedContent, 'utf8', (err: any) => {
|
|
106
108
|
if (err) {
|
|
109
|
+
console.log('replaceFileContent reject 2');
|
|
107
110
|
reject()
|
|
108
111
|
return console.log(err)
|
|
109
112
|
}
|
|
113
|
+
console.log('replaceFileContent, resolve 2');
|
|
110
114
|
resolve()
|
|
111
115
|
})
|
|
112
116
|
})
|