vaderjs 1.3.3-alpha-130 → 1.3.3-alpha-132
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 +1 -1
- package/vader.js +7 -5
package/package.json
CHANGED
package/vader.js
CHANGED
|
@@ -955,17 +955,19 @@ async function Build() {
|
|
|
955
955
|
if(provider){
|
|
956
956
|
|
|
957
957
|
let redirectFile = fs.existsSync(process.cwd() + '/dist/' + provider) ? fs.readFileSync(process.cwd() + '/dist/' + provider, 'utf8') : ''
|
|
958
|
-
let type = provider === '
|
|
958
|
+
let type = provider === '_redirects' ? 'text/plain' : 'application/json'
|
|
959
|
+
|
|
959
960
|
let root = obj.url.includes(':') ? obj.url.split(':')[0] : obj.url
|
|
960
|
-
switch(
|
|
961
|
+
switch(true){
|
|
961
962
|
case root === '/':
|
|
962
963
|
break;
|
|
963
|
-
case 'text/plain' && !redirectFile.includes(obj.url) && obj.url.includes(':'):
|
|
964
|
+
case type === 'text/plain' && !redirectFile.includes(obj.url) && obj.url.includes(':'):
|
|
964
965
|
|
|
965
|
-
redirectFile += `\n${obj.url} ${
|
|
966
|
+
redirectFile += `\n${obj.url} ${root}index.html 200`
|
|
966
967
|
fs.writeFileSync(process.cwd() + '/dist/' + provider, redirectFile)
|
|
968
|
+
console.log(`Added ${obj.url} ${obj.url} 200 to ${provider}`)
|
|
967
969
|
break;
|
|
968
|
-
case 'application/json' && !redirectFile.includes(root):
|
|
970
|
+
case type === 'application/json' && !redirectFile.includes(root):
|
|
969
971
|
let json = JSON.parse(redirectFile) || {}
|
|
970
972
|
let isVercel = provider === 'vercel.json' ? true : false
|
|
971
973
|
if(isVercel){
|