mirror of
https://github.com/ritz078/transform.git
synced 2026-11-20 16:22:53 +03:00
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:
1 parent
38f305faef
commit
ff1492cd91
6 files changed
+510
-695
No files matched your search
@@ -1,7 +1,6 @@
|
||||
{
|
||||
"presets": [
|
||||
"next/babel",
|
||||
"@zeit/next-typescript/babel"
|
||||
"next/babel"
|
||||
],
|
||||
"plugins": [
|
||||
["module-resolver", {
|
||||
|
||||
Vendored
+2
@@ -0,0 +1,2 @@
|
||||
/// <reference types="next" />
|
||||
/// <reference types="next/types/global" />
|
||||
+9
-8
@@ -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
@@ -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
@@ -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"]
|
||||
}
|
||||
Reference in new issue
Block a user