Experimental port to Firebase hosting
This commit is contained in:
@ -1,22 +1,23 @@
|
||||
const mime = require('mime');
|
||||
import mime from 'mime';
|
||||
|
||||
mime.define({
|
||||
'text/plain': [
|
||||
'authors',
|
||||
'changes',
|
||||
'license',
|
||||
'makefile',
|
||||
'patents',
|
||||
'readme',
|
||||
'ts',
|
||||
'flow'
|
||||
]
|
||||
});
|
||||
mime.define(
|
||||
{
|
||||
'text/plain': [
|
||||
'authors',
|
||||
'changes',
|
||||
'license',
|
||||
'makefile',
|
||||
'patents',
|
||||
'readme',
|
||||
'ts',
|
||||
'flow'
|
||||
]
|
||||
},
|
||||
/* force */ true
|
||||
);
|
||||
|
||||
const textFiles = /\/?(\.[a-z]*rc|\.git[a-z]*|\.[a-z]*ignore|\.lock)$/i;
|
||||
|
||||
function getContentType(file) {
|
||||
return textFiles.test(file) ? 'text/plain' : mime.lookup(file);
|
||||
export default function getContentType(file) {
|
||||
return textFiles.test(file) ? 'text/plain' : mime.getType(file);
|
||||
}
|
||||
|
||||
module.exports = getContentType;
|
||||
|
Reference in New Issue
Block a user