mirror of
https://github.com/CompassConnections/Compass.git
synced 2026-03-24 17:41:27 -04:00
Add next config for react email dev server
This commit is contained in:
26
backend/email/next.config.js
Normal file
26
backend/email/next.config.js
Normal file
@@ -0,0 +1,26 @@
|
||||
/** @type {import('next').NextConfig} */
|
||||
// eslint-disable-next-line
|
||||
const path = require('path')
|
||||
const nextConfig = {
|
||||
reactStrictMode: true,
|
||||
swcMinify: true,
|
||||
experimental: {
|
||||
serverComponentsExternalPackages: [
|
||||
'@react-email/components',
|
||||
'@react-email/render',
|
||||
'@react-email/tailwind',
|
||||
],
|
||||
externalDir: true, // compile files that are located next to the .react-email directory
|
||||
},
|
||||
webpack: (config) => {
|
||||
config.resolve.alias = {
|
||||
...config.resolve.alias,
|
||||
common: path.resolve(__dirname, '../../common/lib'),
|
||||
shared: path.resolve(__dirname, '../shared/lib'),
|
||||
email: path.resolve(__dirname, './emails'),
|
||||
}
|
||||
return config
|
||||
},
|
||||
}
|
||||
|
||||
module.exports = nextConfig
|
||||
@@ -4,7 +4,9 @@
|
||||
"private": true,
|
||||
"scripts": {
|
||||
"build": "tsc -b",
|
||||
"predev": "cp next.config.js .react-email/next.config.js",
|
||||
"dev": "email dev --port 3001",
|
||||
"postinstall": "echo 'Setting up email dev, stop the process when it says that react email is ready and then run yarn dev' && yarn dev",
|
||||
"lint": "npx eslint . --max-warnings 0",
|
||||
"lint-fix": "npx eslint . --fix",
|
||||
"test": "jest --config jest.config.ts --passWithNoTests",
|
||||
|
||||
@@ -1,17 +1,14 @@
|
||||
{
|
||||
"extends": "./tsconfig.json",
|
||||
"compilerOptions": {
|
||||
// Use / as the root for tests so path-mapped imports from
|
||||
// ../shared and ../../common are within the configured rootDir.
|
||||
// This avoids TS6059 during ts-jest compilation.
|
||||
"rootDir": "../..",
|
||||
"rootDir": ".",
|
||||
"baseUrl": ".",
|
||||
"paths": {
|
||||
"api/*": ["src/*"],
|
||||
"shared/*": ["../shared/src/*"],
|
||||
"common/*": ["../../common/src/*"],
|
||||
"email/*": ["../email/emails/*"]
|
||||
"email/*": ["./emails/*"]
|
||||
}
|
||||
},
|
||||
"include": ["tests/**/*.ts", "src/**/*.ts"]
|
||||
"include": ["tests/**/*.ts", "emails/**/*.ts", "emails/**/*.tsx"]
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user