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

43 lines
599 B
TypeScript
Raw Normal View History

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