-
Notifications
You must be signed in to change notification settings - Fork 10
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
サーバーをesbuildに変更 #259
Merged
Merged
サーバーをesbuildに変更 #259
Changes from 12 commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
222ff8c
chore(deps): bump normalize-url from 4.5.0 to 4.5.1
dependabot[bot] c2dade4
chore(deps): bump glob-parent from 5.1.1 to 5.1.2
dependabot[bot] 0340126
chore(deps): bump postcss from 7.0.35 to 7.0.36
dependabot[bot] 838f718
chore(deps): bump ws from 7.4.3 to 7.5.3 (#242)
dependabot[bot] 23d8093
chore(deps): bump hosted-git-info from 2.8.8 to 2.8.9
dependabot[bot] c6b8116
add esbuild
IshinoJun db378f3
Merge remote-tracking branch 'upstream/develop' into develop
IshinoJun 5b7aab9
Merge branch 'develop' into add-esbuild
IshinoJun abc2e66
cwd → __dirname
IshinoJun 1244f3d
typeormのみ対象外に修正
IshinoJun 35647d7
不要な修正
IshinoJun 4f3b8ab
targetを指定してみた
IshinoJun 223b73d
respawn オプション追加
IshinoJun File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
esbuild | ||
esbuild-node-externals | ||
node-dev |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,4 @@ | ||
prisma | ||
esbuild | ||
esbuild-node-externals | ||
node-dev |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
webpack | ||
webpack-cli | ||
webpack-node-externals | ||
tsconfig-paths-webpack-plugin | ||
nodemon-webpack-plugin |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
const { build } = require('esbuild') | ||
const config = require('./config.dev.js') | ||
|
||
build(config) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
const { build } = require('esbuild') | ||
const config = require('./config.prod.js') | ||
|
||
build(config).catch(() => process.exit(1)) |
12 changes: 12 additions & 0 deletions
12
server/templates/server/@orm=none/scripts/config.common.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
const { nodeExternalsPlugin } = require('esbuild-node-externals') | ||
const path = require('path') | ||
|
||
module.exports = { | ||
entryPoints: [path.resolve(__dirname, '../entrypoints/index.ts')], | ||
outdir: path.resolve(__dirname, '../'), | ||
platform: 'node', | ||
target: 'node12', | ||
bundle: true, | ||
plugins: [nodeExternalsPlugin()], | ||
logLevel: 'info' | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
const config = require('./config.common') | ||
|
||
module.exports = Object.assign(config, { | ||
watch: true, | ||
define: { | ||
'process.env.NODE_ENV': `"development"` | ||
} | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
const config = require('./config.common') | ||
|
||
module.exports = Object.assign(config, { | ||
minify: true, | ||
define: { | ||
'process.env.NODE_ENV': `"production"` | ||
} | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
const { build } = require('esbuild') | ||
const config = require('./config.dev.js') | ||
|
||
build(config) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
const { build } = require('esbuild') | ||
const config = require('./config.prod.js') | ||
|
||
build(config).catch(() => process.exit(1)) |
14 changes: 14 additions & 0 deletions
14
server/templates/server/@orm=prisma/scripts/config.common.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
const { nodeExternalsPlugin } = require('esbuild-node-externals') | ||
const path = require('path') | ||
|
||
module.exports = { | ||
entryPoints: [path.resolve(__dirname, '../entrypoints/index.ts')<% if (serverless === 'lambda') { %>, | ||
path.resolve(__dirname, '../entrypoints/lambda.ts'), | ||
path.resolve(__dirname, '../entrypoints/lambda_migration.ts')<% } %>], | ||
outdir: path.resolve(__dirname, '../'), | ||
platform: 'node', | ||
target: 'node12', | ||
bundle: true, | ||
plugins: [nodeExternalsPlugin()], | ||
logLevel: 'info' | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
const config = require('./config.common') | ||
|
||
module.exports = Object.assign(config, { | ||
watch: true, | ||
define: { | ||
'process.env.NODE_ENV': `"development"` | ||
} | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
const config = require('./config.common') | ||
|
||
module.exports = Object.assign(config, { | ||
minify: true, | ||
define: { | ||
'process.env.NODE_ENV': `"production"` | ||
} | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,6 @@ | ||
cross-env | ||
nodemon-webpack-plugin | ||
npm-run-all | ||
ts-loader | ||
ts-node | ||
tsconfig-paths-webpack-plugin | ||
typescript | ||
webpack | ||
webpack-cli | ||
webpack-node-externals | ||
@types/jest | ||
@types/jest |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Long living 系は
node-dev --respawn
と指定しないと、 index.ts をいじって、一瞬、すぐ終わる形になったときに、再起動しなくなる。あったほうがよいかも?