Upgrade Next.js to 9 (#126)

* Upgrade Next.js to 9

* Add back engines key

* Add globalObject

Brings in suggestion from https://github.com/zeit/next.js/issues/7873#issuecomment-512795482

* Add temporary fix for window issue
This commit is contained in:
Tim Neutkens authored and Ritesh Kumar committed 2019-07-23 18:57:34 +05:30
1 parent 38f305faef
commit ff1492cd91
6 files changed
+510 -695

No files matched your search

+1 -2
View File
@@ -1,7 +1,6 @@
{
"presets": [
"next/babel",
"@zeit/next-typescript/babel"
"next/babel"
],
"plugins": [
["module-resolver", {
+2
View File
@@ -0,0 +1,2 @@
/// <reference types="next" />
/// <reference types="next/types/global" />
+9 -8
View File
@@ -1,5 +1,3 @@
const withTypescript = require("@zeit/next-typescript");
const ForkTsCheckerWebpackPlugin = require("fork-ts-checker-webpack-plugin");
const withCSS = require("@zeit/next-css");
const webpack = require("webpack");
const MonacoWebpackPlugin = require("monaco-editor-webpack-plugin");
@@ -13,9 +11,6 @@ const config = {
tls: "mock"
};
if (options.isServer && options.dev)
config.plugins.push(new ForkTsCheckerWebpackPlugin());
config.plugins.push(
new webpack.DefinePlugin({
"process.env.DEV": JSON.stringify(options.dev),
@@ -61,12 +56,18 @@ const config = {
}
});
config.output.globalObject = `this`;
config.output.globalObject = 'typeof self !== "object" ? self : this';
// Temporary fix for https://github.com/zeit/next.js/issues/8071
config.plugins.forEach(plugin => {
if (plugin.definitions && plugin.definitions["typeof window"]) {
delete plugin.definitions["typeof window"];
}
});
return config;
},
target: "serverless"
};
module.exports = withCSS(withTypescript(config));
module.exports = withCSS(config);
+1 -3
View File
@@ -61,7 +61,7 @@
"lodash": "^4.17.14",
"markdown": "^0.5.0",
"monaco-editor": "^0.17.1",
"next": "^8.1.0",
"next": "^9.0.2",
"nprogress": "^0.2.0",
"postcss": "^7.0.17",
"postcss-js": "^2.0.2",
@@ -85,9 +85,7 @@
"@types/react": "^16.8.23",
"@types/svgo": "^1.2.0",
"@zeit/next-css": "^1.0.1",
"@zeit/next-typescript": "1.1.1",
"babel-plugin-module-resolver": "^3.2.0",
"fork-ts-checker-webpack-plugin": "^1.4.3",
"husky": "^3.0.0",
"imagemin-lint-staged": "^0.4.0",
"lint-staged": "^9.2.0",
+11 -4
View File
@@ -2,8 +2,8 @@
"compileOnSave": false,
"compilerOptions": {
"target": "esnext",
"jsx": "react",
"module": "commonjs",
"jsx": "preserve",
"module": "esnext",
"moduleResolution": "node",
"allowSyntheticDefaultImports": true,
"resolveJsonModule": true,
@@ -25,7 +25,14 @@
},
"lib": ["dom", "es2016", "webworker"],
"typeRoots": ["./node_modules/@types", "./typings/npm"],
"skipDefaultLibCheck": true
"skipDefaultLibCheck": true,
"allowJs": true,
"strict": false,
"forceConsistentCasingInFileNames": true,
"noEmit": true,
"esModuleInterop": true,
"isolatedModules": true
},
"exclude": ["static", "public", ".next", "node_modules"]
"exclude": ["static", "public", ".next", "node_modules"],
"include": ["next-env.d.ts", "**/*.ts", "**/*.tsx"]
}
+486 -678
View File
File diff suppressed because it is too large. Load diff