Skip to content

Commit

Permalink
use new next compiler
Browse files Browse the repository at this point in the history
  • Loading branch information
bmstefanski committed Feb 13, 2022
1 parent 6f4e055 commit d892560
Show file tree
Hide file tree
Showing 6 changed files with 153 additions and 1,089 deletions.
4 changes: 0 additions & 4 deletions .babelrc

This file was deleted.

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
7 changes: 4 additions & 3 deletions next.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,11 @@ module.exports = withBundleAnalyzer({
deviceSizes: [320, 640, 1080, 1200],
imageSizes: [64, 128],
},
swcMinify: true,
compiler: {
styledComponents: true,
},
webpack: (config, { buildId, dev, isServer, defaultLoaders, webpack }) => {
if (!dev) {
config.plugins.push(new CopyPlugin({ patterns: [{ from: 'posts', to: 'posts' }] }));
}
config.module.rules.push({
test: /\.svg$/,
issuer: {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"date-fns": "^2.24.0",
"gray-matter": "^4.0.3",
"lodash": "^4.17.21",
"next": "11.1.3",
"next": "12.0.11-canary.15",
"nextjs-color-mode": "^1.0.4",
"polished": "^4.1.3",
"prism-react-renderer": "^1.2.1",
Expand Down
3 changes: 0 additions & 3 deletions utils/postsFetcher.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,5 @@ export async function getSinglePost(slug: string): Promise<SingleArticle> {

export function getPostsDirectory() {
let basePath = process.cwd();
if (process.env.NODE_ENV === 'production') {
basePath = path.join(process.cwd(), '.next/server/chunks');
}
return path.join(basePath, 'posts');
}
Loading

1 comment on commit d892560

@vercel
Copy link

@vercel vercel bot commented on d892560 Feb 13, 2022

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.