Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add esbuild config to CLI build and dev #2564

Merged
merged 5 commits into from
Jun 1, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions packages/cli/src/commands/build.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import Listr from 'listr'
import VerboseRenderer from 'listr-verbose-renderer'
import terminalLink from 'terminal-link'

import { getConfig } from '@redwoodjs/internal'
import { detectPrerenderRoutes } from '@redwoodjs/prerender'

import { getPaths } from 'src/lib'
Expand Down Expand Up @@ -64,6 +65,7 @@ export const builder = (yargs) => {
.option('esbuild', {
type: 'boolean',
required: false,
default: getConfig().experimental.esbuild,
thedavidprice marked this conversation as resolved.
Show resolved Hide resolved
description: 'Use ESBuild for api side [experimental]',
})
.epilogue(
Expand Down
1 change: 1 addition & 0 deletions packages/cli/src/commands/dev.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ export const builder = (yargs) => {
.option('esbuild', {
type: 'boolean',
required: false,
default: getConfig().experimental.esbuild,
thedavidprice marked this conversation as resolved.
Show resolved Hide resolved
description: 'Use ESBuild [experimental]',
})
.option('generate', {
Expand Down
2 changes: 2 additions & 0 deletions packages/create-redwood-app/template/redwood.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,5 @@
schemaPath = "./api/db/schema.prisma"
[browser]
open = true
[experimental]
esbuild = false
3 changes: 3 additions & 0 deletions packages/internal/src/__tests__/config.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ describe('getConfig', () => {
"browser": Object {
"open": false,
},
"experimental": Object {
"esbuild": false,
},
"generate": Object {
"stories": true,
"tests": true,
Expand Down
6 changes: 6 additions & 0 deletions packages/internal/src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,9 @@ export interface Config {
tests: boolean
stories: boolean
}
experimental: {
esbuild: boolean
}
}

// Note that web's includeEnvironmentVariables is handled in `webpack.common.js`
Expand Down Expand Up @@ -73,6 +76,9 @@ const DEFAULT_CONFIG: Config = {
tests: true,
stories: true,
},
experimental: {
esbuild: false,
}
}

/**
Expand Down