create-react-ssr/src/server/index.ts

43 lines
599 B
TypeScript

require('dotenv').config();
require('ignore-styles');
require('@babel/register')({
'presets': [
['@babel/preset-env', {'targets': {'node': 'current'}}],
'@babel/preset-react',
'@babel/preset-typescript',
]
});
require('asset-require-hook')({
extensions: [
// images
'jpg',
'png',
'svg',
'gif',
'ico',
// videos
'mp4',
'avi',
// files
'pdf',
],
name: '/assets/media/[name].[ext]',
});
require('asset-require-hook')({
extensions: [
// typography
'ttf',
'otf',
'eot',
'woff',
'woff2',
],
name: '/assets/fonts/[name].[ext]',
});
require('./server');