Skip to content
This repository was archived by the owner on Aug 27, 2020. It is now read-only.

Commit 23835ef

Browse files
committed
migration: babel config
1 parent 15b4c31 commit 23835ef

File tree

5 files changed

+22
-18
lines changed

5 files changed

+22
-18
lines changed

.babelrc

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

.babelrc.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
const env = {
2+
'process.env.NODE_ENV': process.env.NODE_ENV
3+
}
4+
module.exports = {
5+
presets: ['next/babel'],
6+
plugins: [['transform-define-file', env]]
7+
}
8+
9+

package-lock.json

Lines changed: 11 additions & 8 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@
4747
"@zeit/next-css": "^0.2.0",
4848
"@zeit/next-typescript": "^1.0.0",
4949
"babel-plugin-transform-define": "^1.3.0",
50+
"babel-plugin-transform-define-file": "^1.3.2",
5051
"cssnano": "^3.10.0",
5152
"enzyme": "^3.3.0",
5253
"enzyme-adapter-react-16": "^1.1.1",

pages/_document.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,7 @@ import {
77

88
export default class extends Document {
99
static async getInitialProps(...args) {
10-
const d: any = Document
11-
const documentProps = await d.getInitialProps(...args)
10+
const documentProps = await Document.getInitialProps(...args)
1211
const {req, renderPage} = args[0]
1312
const page = renderPage()
1413

0 commit comments

Comments
 (0)