chore(scripts): devnew script
This commit is contained in:
@@ -13,6 +13,7 @@
|
||||
"clean:cache": "rimraf node_modules/.cache && rimraf packages/payload/node_modules/.cache",
|
||||
"clean:unix": "find . \\( -type d \\( -name node_modules -o -name dist -o -name .cache \\) -o -type f -name tsconfig.tsbuildinfo \\) -exec rm -rf {} +",
|
||||
"dev": "next dev",
|
||||
"devnew": "cross-env node ./test/devnew.js",
|
||||
"dev:generate-graphql-schema": "ts-node -T ./test/generateGraphQLSchema.ts",
|
||||
"dev:generate-types": "ts-node -T ./test/generateTypes.ts",
|
||||
"dev:postgres": "pnpm --filter payload run dev:postgres",
|
||||
|
||||
25
test/devnew.js
Normal file
25
test/devnew.js
Normal file
@@ -0,0 +1,25 @@
|
||||
/* eslint-disable @typescript-eslint/no-var-requires */
|
||||
const minimist = require('minimist')
|
||||
const path = require('path')
|
||||
const { nextDev } = require(path.resolve(__dirname, '..', 'node_modules/next/dist/cli/next-dev'))
|
||||
|
||||
main()
|
||||
|
||||
async function main() {
|
||||
const {
|
||||
_: [testSuiteArg],
|
||||
...args
|
||||
} = minimist(process.argv.slice(2))
|
||||
|
||||
if (args.turbo) {
|
||||
process.env.TURBOPACK = '1'
|
||||
}
|
||||
|
||||
const testSuite = testSuiteArg || '_community'
|
||||
console.log('Using config:', testSuite, '\n')
|
||||
|
||||
const PAYLOAD_CONFIG_PATH = path.resolve(testSuite, 'config')
|
||||
process.env.PAYLOAD_CONFIG_PATH = PAYLOAD_CONFIG_PATH
|
||||
|
||||
nextDev({ _: [path.resolve(__dirname, '..')] })
|
||||
}
|
||||
Reference in New Issue
Block a user