Skip to content

Commit d892560

Browse files
committed
use new next compiler
1 parent 6f4e055 commit d892560

File tree

6 files changed

+153
-1089
lines changed

6 files changed

+153
-1089
lines changed

.babelrc

Lines changed: 0 additions & 4 deletions
This file was deleted.

next-env.d.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
/// <reference types="next" />
2-
/// <reference types="next/types/global" />
32
/// <reference types="next/image-types/global" />
43

54
// NOTE: This file should not be edited

next.config.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,11 @@ module.exports = withBundleAnalyzer({
1212
deviceSizes: [320, 640, 1080, 1200],
1313
imageSizes: [64, 128],
1414
},
15+
swcMinify: true,
16+
compiler: {
17+
styledComponents: true,
18+
},
1519
webpack: (config, { buildId, dev, isServer, defaultLoaders, webpack }) => {
16-
if (!dev) {
17-
config.plugins.push(new CopyPlugin({ patterns: [{ from: 'posts', to: 'posts' }] }));
18-
}
1920
config.module.rules.push({
2021
test: /\.svg$/,
2122
issuer: {

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
"date-fns": "^2.24.0",
1818
"gray-matter": "^4.0.3",
1919
"lodash": "^4.17.21",
20-
"next": "11.1.3",
20+
"next": "12.0.11-canary.15",
2121
"nextjs-color-mode": "^1.0.4",
2222
"polished": "^4.1.3",
2323
"prism-react-renderer": "^1.2.1",

utils/postsFetcher.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,5 @@ export async function getSinglePost(slug: string): Promise<SingleArticle> {
2525

2626
export function getPostsDirectory() {
2727
let basePath = process.cwd();
28-
if (process.env.NODE_ENV === 'production') {
29-
basePath = path.join(process.cwd(), '.next/server/chunks');
30-
}
3128
return path.join(basePath, 'posts');
3229
}

0 commit comments

Comments
 (0)