chore: initializes payload before build
This commit is contained in:
0
docs/admin/bundlers.mdx
Normal file
0
docs/admin/bundlers.mdx
Normal file
0
docs/configuration/database.mdx
Normal file
0
docs/configuration/database.mdx
Normal file
19
docs/database/mongodb.mdx
Normal file
19
docs/database/mongodb.mdx
Normal file
@@ -0,0 +1,19 @@
|
||||
---
|
||||
title: MongoDB
|
||||
label: MongoDB
|
||||
order: 20
|
||||
desc: Payload has supported MongoDB natively since alpha. The flexible nature of MongoDB lends itself well to Payload's powerful fields.
|
||||
keywords: MongoDB, documentation, typescript, Content Management System, cms, headless, javascript, node, react, express
|
||||
---
|
||||
|
||||
##### `mongoURL`
|
||||
|
||||
**Required**. This is a fully qualified MongoDB connection string that points to your MongoDB database. If you don't have MongoDB installed locally, you can [follow these steps for Mac OSX](https://docs.mongodb.com/manual/tutorial/install-mongodb-on-os-x/) and [these steps](https://docs.mongodb.com/manual/tutorial/install-mongodb-on-windows/) for Windows 10. If you want to use a local database and you know you have MongoDB installed locally, a typical connection string will look like this:
|
||||
|
||||
`mongodb://127.0.0.1/payload`
|
||||
|
||||
In contrast to running MongoDB locally, a popular option is to sign up for a free [MongoDB Atlas account](https://www.mongodb.com/cloud/atlas), which is a fully hosted and cloud-based installation of MongoDB that you don't need to ever worry about.
|
||||
|
||||
##### `mongoOptions`
|
||||
|
||||
Customize MongoDB connection options. Payload will connect to your MongoDB database using default options which you can override and extend to include all the [options](https://mongoosejs.com/docs/connections.html#options) available to mongoose.
|
||||
7
docs/database/postgres.mdx
Normal file
7
docs/database/postgres.mdx
Normal file
@@ -0,0 +1,7 @@
|
||||
---
|
||||
title: Postgres
|
||||
label: Postgres
|
||||
order: 30
|
||||
desc: Payload supports Postgres through an officially supported Drizzle database adapter.
|
||||
keywords: Postgres, documentation, typescript, Content Management System, cms, headless, javascript, node, react, express
|
||||
---
|
||||
@@ -62,8 +62,9 @@ export const getViteConfig = async (payloadConfig: SanitizedConfig): Promise<Inl
|
||||
__dirname: '"/"',
|
||||
'module.hot': 'undefined',
|
||||
'process.argv': '[]',
|
||||
'process.cwd': '() => ""',
|
||||
'process.cwd': 'function () { return "/" }',
|
||||
'process.env': '{}',
|
||||
'process?.cwd': 'function () { return "/" }',
|
||||
}
|
||||
|
||||
Object.entries(process.env).forEach(([key, val]) => {
|
||||
|
||||
@@ -1,8 +1,16 @@
|
||||
import payload from '..'
|
||||
import loadConfig from '../config/load'
|
||||
|
||||
export const build = async (): Promise<void> => {
|
||||
const config = await loadConfig() // Will throw its own error if it fails
|
||||
|
||||
await payload.init({
|
||||
disableDBConnect: true,
|
||||
disableOnInit: true,
|
||||
local: true,
|
||||
secret: '--unused--',
|
||||
})
|
||||
|
||||
await config.admin.bundler.build(config)
|
||||
}
|
||||
|
||||
|
||||
@@ -13,8 +13,8 @@ export async function generateGraphQLSchema(): Promise<void> {
|
||||
config.db = null
|
||||
|
||||
await payload.init({
|
||||
disableOnInit: true,
|
||||
disableDBConnect: true,
|
||||
disableOnInit: true,
|
||||
local: true,
|
||||
secret: '--unused--',
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user