Skip to content

Commit

Permalink
Merge pull request #60 from stack-wuh/feat-next-next
Browse files Browse the repository at this point in the history
Feat next next
  • Loading branch information
stack-wuh committed Dec 13, 2021
2 parents 9597991 + 6198cba commit 51c49b1
Show file tree
Hide file tree
Showing 6 changed files with 259 additions and 347 deletions.
3 changes: 3 additions & 0 deletions .babelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"presets": ["next/babel"]
}
1 change: 0 additions & 1 deletion next-env.d.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
/// <reference types="next" />
/// <reference types="next/types/global" />
/// <reference types="next/image-types/global" />

// NOTE: This file should not be edited
Expand Down
85 changes: 46 additions & 39 deletions next.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,49 +3,56 @@ const nextComposePlugins = require('next-compose-plugins')
const withPreact = require('next-plugin-preact')
const ProgressBarPlugin = require('progress-bar-webpack-plugin')
const withBundleAnalyzer = require('@next/bundle-analyzer')({
enabled: process.env.ANALYZE === 'true',
enabled: process.env.ANALYZE === 'true',
})
const {
green
} = require('chalk')
const { green } = require('chalk')

/** @type {import('next').NextConfig} */
let config = {
reactStrictMode: true,
webpack5: true,
compress: true,
generateEtags: false,
poweredByHeader: false,
trailingSlash: false,
productionBrowserSourceMaps: false,
httpAgentOptions: {
keepAlive: true
},
images: {
domains: ['src.wuh.site'],
imageSizes: [16, 32, 48, 64, 96, 128, 256, 384],
},
experimental: {
pageDataCollectionTimeout: 120000
},
webpack: (config, { dev }) => {
if (!dev) {
config.plugins.push(new CompressionWebpackPlugin({
algorithm: "gzip",
test: /\.js$|\.css$/,
threshold: 10240,
exclude: /\/node_modules/,
filename: '[base].gz',
deleteOriginalAssets: false
}))
}
config.plugins.push(new ProgressBarPlugin({
format: `build [:bar] ${green.bold(':percent')} (:elapsed s, :current / :total) :msg`,
clear: false
}))
reactStrictMode: true,
webpack5: true,
compress: true,
generateEtags: false,
poweredByHeader: false,
trailingSlash: false,
productionBrowserSourceMaps: false,
httpAgentOptions: {
keepAlive: true,
},
images: {
domains: ['src.wuh.site'],
imageSizes: [16, 32, 48, 64, 96, 128, 256, 384],
},
experimental: {
pageDataCollectionTimeout: 120000,
},
webpack: (config, { dev }) => {
if (!dev) {
config.plugins.push(
new CompressionWebpackPlugin({
algorithm: 'gzip',
test: /\.js$|\.css$/,
threshold: 10240,
exclude: /\/node_modules/,
filename: '[base].gz',
deleteOriginalAssets: false,
})
)
}
config.plugins.push(
new ProgressBarPlugin({
format: `build [:bar] ${green.bold(
':percent'
)} (:elapsed s, :current / :total) :msg`,
clear: false,
})
)

return config
}
return config
},
eslint: {
ignoreDuringBuilds: true,
},
}

module.exports = nextComposePlugins([withPreact, withBundleAnalyzer], config)
module.exports = nextComposePlugins([withPreact, withBundleAnalyzer], config)
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
"conventional-changelog-cli": "^2.1.1",
"dayjs": "^1.10.7",
"isomorphic-fetch": "^3.0.0",
"next": "11.1.3",
"next": "^12.0.7",
"next-seo": "^4.28.1",
"nprogress": "^0.2.0",
"preact": "^10.5.14",
Expand All @@ -34,6 +34,7 @@
"react-transition-group": "^4.4.2",
"remark": "^14.0.1",
"remark-html": "^15.0.0",
"scheduler": "^0.20.2",
"swr": "^1.0.1"
},
"devDependencies": {
Expand Down
67 changes: 51 additions & 16 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,11 @@
"compilerOptions": {
"baseUrl": ".",
"target": "esnext",
"lib": ["dom", "dom.iterable", "esnext"],
"lib": [
"dom",
"dom.iterable",
"esnext"
],
"allowJs": true,
"skipLibCheck": true,
"strict": true,
Expand All @@ -15,20 +19,51 @@
"isolatedModules": true,
"jsx": "preserve",
"paths": {
"@/*": ["."],
"@/pages/*": ["pages/*"],
"@/components/*": ["components/*"],
"@/lib/*": ["lib/*"],
"@/middlewares/*": ["middlewares/*"],
"@/hooks/*": ["hooks/*"],
"@/db/*": ["db/*"],
"@/layout/*": ["layout/*"],
"@/styles/*": ["styles/*"],
"@/store/*": ["store/*"],
"@/constant/*": ["constant/*"],
"@/__utils/*": ["__utils/*"]
}
"@/*": [
"."
],
"@/pages/*": [
"pages/*"
],
"@/components/*": [
"components/*"
],
"@/lib/*": [
"lib/*"
],
"@/middlewares/*": [
"middlewares/*"
],
"@/hooks/*": [
"hooks/*"
],
"@/db/*": [
"db/*"
],
"@/layout/*": [
"layout/*"
],
"@/styles/*": [
"styles/*"
],
"@/store/*": [
"store/*"
],
"@/constant/*": [
"constant/*"
],
"@/__utils/*": [
"__utils/*"
]
},
"incremental": true
},
"include": ["next-env.d.ts", "**/*.ts", "**/*.tsx"],
"exclude": ["node_modules"]
"include": [
"next-env.d.ts",
"**/*.ts",
"**/*.tsx"
],
"exclude": [
"node_modules"
]
}
Loading

2 comments on commit 51c49b1

@vercel
Copy link

@vercel vercel bot commented on 51c49b1 Dec 13, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Deployment failed with the following error:

The most recent charge for your active payment method has failed. Please update it here: https://vercel.com/teams/163m/settings/billing.

@vercel
Copy link

@vercel vercel bot commented on 51c49b1 Dec 13, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.