Skip to content

Commit

Permalink
build(esbuild): remove minify flag
Browse files Browse the repository at this point in the history
  • Loading branch information
wd-David committed May 3, 2022
1 parent 95bc988 commit 9b3dc99
Show file tree
Hide file tree
Showing 7 changed files with 54 additions and 58 deletions.
1 change: 0 additions & 1 deletion build.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ esbuild.build({
entryPoints,
logLevel: 'info',
outdir: 'build',
minify: true,
bundle: true,
platform: 'node'
})
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"scripts": {
"prepare": "husky install",
"dev": "nodemon",
"build": "rm -rf build && esbuild `find src \\( -name '*.ts' \\)` --platform=node --outdir=build --bundle --minify",
"build": "rm -rf build && esbuild `find src \\( -name '*.ts' \\)` --platform=node --outdir=build --bundle",
"build:windows": "rm -rf build && node ./build.js",
"format": "prettier --write 'src/**/*.{js,ts,json,md}'",
"lint": "prettier --check 'src/**/*.{js,ts,json,md}' && eslint --ignore-path .gitignore .",
Expand Down Expand Up @@ -35,9 +35,9 @@
"typescript": "^4.6.4"
},
"dependencies": {
"@fastify/autoload": "^4.0.0",
"@fastify/sensible": "^4.0.0",
"fastify": "^3.29.0",
"fastify-autoload": "^3.13.0",
"fastify-plugin": "^3.0.1",
"fastify-sensible": "^3.2.0"
"fastify-plugin": "^3.0.1"
}
}
82 changes: 34 additions & 48 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { join } from 'path'
import Fastify from 'fastify'
import autoLoad from 'fastify-autoload'
import autoLoad from '@fastify/autoload'

const fastify = Fastify({
logger: true
Expand Down
2 changes: 1 addition & 1 deletion src/plugins/sensible.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import fp from 'fastify-plugin'
import sensible, { SensibleOptions } from 'fastify-sensible'
import sensible, { SensibleOptions } from '@fastify/sensible'

/**
* This plugins adds some utilities to handle http errors
Expand Down
10 changes: 10 additions & 0 deletions src/routes/bad-request/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import { FastifyPluginAsync } from 'fastify'

const badRequest: FastifyPluginAsync = async (fastify): Promise<void> => {
// Note: using an arrow function will break the binding of this to the FastifyInstance.
fastify.get('/', async function (req, reply) {
reply.badRequest()
})
}

export default badRequest
7 changes: 4 additions & 3 deletions src/routes/examples/index.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import { FastifyPluginAsync } from 'fastify'

const example: FastifyPluginAsync = async (fastify, opts): Promise<void> => {
fastify.get('/', async function (request, reply) {
return 'this is an example'
const example: FastifyPluginAsync = async (fastify): Promise<void> => {
// Note: using an arrow function will break the binding of this to the FastifyInstance.
fastify.get('/', async function (req, reply) {
return this.someSupport()
})
}

Expand Down

0 comments on commit 9b3dc99

Please sign in to comment.