@vv0rkz/js-template 1.6.3 → 1.6.4
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/bin/init.js +7 -1
- package/package.json +1 -1
package/bin/init.js
CHANGED
|
@@ -23,7 +23,7 @@ function askQuestion(query) {
|
|
|
23
23
|
rl.question(query, (ans) => {
|
|
24
24
|
rl.close()
|
|
25
25
|
resolve(ans)
|
|
26
|
-
})
|
|
26
|
+
}),
|
|
27
27
|
)
|
|
28
28
|
}
|
|
29
29
|
|
|
@@ -139,6 +139,12 @@ if (existsSync(packageJsonPath)) {
|
|
|
139
139
|
}
|
|
140
140
|
packageJson.devDependencies['@vv0rkz/js-template'] = '^1.4.0'
|
|
141
141
|
|
|
142
|
+
// Проверка и установка type: module для ES модулей
|
|
143
|
+
if (!packageJson.type || packageJson.type === 'commonjs') {
|
|
144
|
+
packageJson.type = 'module'
|
|
145
|
+
console.log(' ⚙️ Установлен "type": "module" (для ES модулей)')
|
|
146
|
+
}
|
|
147
|
+
|
|
142
148
|
writeFileSync(packageJsonPath, JSON.stringify(packageJson, null, 2))
|
|
143
149
|
console.log(' ✅ Скрипты добавлены')
|
|
144
150
|
console.log(' npm run jst или npm run _')
|