Skip to content

Commit

Permalink
Merge branch 'release/v7'
Browse files Browse the repository at this point in the history
  • Loading branch information
saltyshiomix committed Jul 24, 2021
2 parents 743e96c + f43ff78 commit d0f13ab
Show file tree
Hide file tree
Showing 39 changed files with 206 additions and 2,188 deletions.
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@

| nextron | next |
| --- | --- |
| `v7.x` | `v11.x` |
| `v6.x` | `v10.x` |
| `v5.x` | `v9.x` |
| `v4.x` | `v8.x` |
Expand Down Expand Up @@ -127,9 +128,9 @@ module.exports = {
rendererSrcDir: 'renderer',

// main process' webpack config
webpack: (defaultConfig, env) => {
webpack: (config, env) => {
// do some stuff here
return defaultConfig;
return config;
},
};
```
Expand Down
4 changes: 2 additions & 2 deletions examples/custom-build-options/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@
"devDependencies": {
"electron": "^13.1.7",
"electron-builder": "^22.11.7",
"next": "^10.2.3",
"nextron": "^6.1.0",
"next": "^11.0.1",
"nextron": "^7.0.0",
"react": "^17.0.2",
"react-dom": "^17.0.2"
}
Expand Down
10 changes: 7 additions & 3 deletions examples/custom-build-options/renderer/next.config.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
module.exports = {
webpack: (config) => Object.assign(config, {
target: 'electron-renderer',
}),
webpack: (config, { isServer }) => {
if (!isServer) {
config.target = 'electron-renderer';
}

return config;
},
};
4 changes: 2 additions & 2 deletions examples/custom-main-entry/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
"devDependencies": {
"electron": "^13.1.7",
"electron-builder": "^22.11.7",
"next": "^10.2.3",
"nextron": "^6.1.0",
"next": "^11.0.1",
"nextron": "^7.0.0",
"react": "^17.0.2",
"react-dom": "^17.0.2"
}
Expand Down
10 changes: 7 additions & 3 deletions examples/custom-main-entry/renderer/next.config.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
module.exports = {
webpack: (config) => Object.assign(config, {
target: 'electron-renderer',
}),
webpack: (config, { isServer }) => {
if (!isServer) {
config.target = 'electron-renderer';
}

return config;
},
};
4 changes: 2 additions & 2 deletions examples/custom-renderer-port/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
"devDependencies": {
"electron": "^13.1.7",
"electron-builder": "^22.11.7",
"next": "^10.2.3",
"nextron": "^6.1.0",
"next": "^11.0.1",
"nextron": "^7.0.0",
"react": "^17.0.2",
"react-dom": "^17.0.2"
}
Expand Down
10 changes: 7 additions & 3 deletions examples/custom-renderer-port/renderer/next.config.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
module.exports = {
webpack: (config) => Object.assign(config, {
target: 'electron-renderer',
}),
webpack: (config, { isServer }) => {
if (!isServer) {
config.target = 'electron-renderer';
}

return config;
},
};
4 changes: 2 additions & 2 deletions examples/ipc-communication/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
"devDependencies": {
"electron": "^13.1.7",
"electron-builder": "^22.11.7",
"next": "^10.2.3",
"nextron": "^6.1.0",
"next": "^11.0.1",
"nextron": "^7.0.0",
"react": "^17.0.2",
"react-dom": "^17.0.2"
}
Expand Down
10 changes: 7 additions & 3 deletions examples/ipc-communication/renderer/next.config.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
module.exports = {
webpack: (config) => Object.assign(config, {
target: 'electron-renderer',
}),
webpack: (config, { isServer }) => {
if (!isServer) {
config.target = 'electron-renderer';
}

return config;
},
};
4 changes: 2 additions & 2 deletions examples/store-data/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
"devDependencies": {
"electron": "^13.1.7",
"electron-builder": "^22.11.7",
"next": "^10.2.3",
"nextron": "^6.1.0",
"next": "^11.0.1",
"nextron": "^7.0.0",
"react": "^17.0.2",
"react-dom": "^17.0.2"
}
Expand Down
10 changes: 7 additions & 3 deletions examples/store-data/renderer/next.config.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
module.exports = {
webpack: (config) => Object.assign(config, {
target: 'electron-renderer',
}),
webpack: (config, { isServer }) => {
if (!isServer) {
config.target = 'electron-renderer';
}

return config;
},
};
10 changes: 5 additions & 5 deletions examples/with-javascript-ant-design/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,18 +15,18 @@
"electron-store": "^8.0.0"
},
"devDependencies": {
"@babel/core": "^7.13.14",
"@babel/core": "^7.14.8",
"@zeit/next-css": "^1.0.1",
"antd": "^4.15.0",
"antd": "^4.16.8",
"babel-loader": "^8.2.2",
"babel-plugin-import": "^1.13.3",
"electron": "^13.1.7",
"electron-builder": "^22.11.7",
"next": "^10.2.3",
"nextron": "^6.1.0",
"next": "^11.0.1",
"nextron": "^7.0.0",
"null-loader": "^4.0.1",
"react": "^17.0.2",
"react-dom": "^17.0.2",
"webpack": "4.44.1"
"webpack": "^4.46.0"
}
}
9 changes: 6 additions & 3 deletions examples/with-javascript-ant-design/renderer/next.config.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,17 @@
const withCss = require('@zeit/next-css');

module.exports = withCss({
webpack5: false,
webpack: (config, { isServer }) => {
config.target = 'electron-renderer';
if (!isServer) {
config.target = 'electron-renderer';
}

if (isServer) {
const antStyles = /antd\/.*?\/style\/css.*?/;
const origExternals = [...config.externals];
config.externals = [
(context, request, callback) => {
config.externals = [ // eslint-disable-line
(context, request, callback) => { // eslint-disable-line
if (request.match(antStyles)) return callback();
if (typeof origExternals[0] === 'function') {
origExternals[0](context, request, callback);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ export default class MyDocument extends Document {
<Html>
<Head>
<meta charSet='utf-8' />
<title>Home - Nextron (with-typescript-ant-design)</title>
</Head>
<body>
<Main />
Expand Down
2 changes: 2 additions & 0 deletions examples/with-javascript-ant-design/renderer/pages/next.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,13 @@ function Next() {
<Head>
<title>Next - Nextron (with-javascript-ant-design)</title>
</Head>

<Header>
<Link href="/home">
<a>Go to home page</a>
</Link>
</Header>

<Content style={{ padding: 48 }}>
<Result
status="success"
Expand Down
4 changes: 2 additions & 2 deletions examples/with-javascript-emotion/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@
"@emotion/styled": "^11.3.0",
"electron": "^13.1.7",
"electron-builder": "^22.11.7",
"next": "^10.2.3",
"nextron": "^6.1.0",
"next": "^11.0.1",
"nextron": "^7.0.0",
"react": "^17.0.2",
"react-dom": "^17.0.2"
}
Expand Down
10 changes: 7 additions & 3 deletions examples/with-javascript-emotion/renderer/next.config.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
module.exports = {
webpack: (config) => Object.assign(config, {
target: 'electron-renderer',
}),
webpack: (config, { isServer }) => {
if (!isServer) {
config.target = 'electron-renderer';
}

return config;
},
};
4 changes: 2 additions & 2 deletions examples/with-javascript-material-ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@
"@material-ui/core": "^4.12.2",
"electron": "^13.1.7",
"electron-builder": "^22.11.7",
"next": "^10.2.3",
"nextron": "^6.1.0",
"next": "^11.0.1",
"nextron": "^7.0.0",
"react": "^17.0.2",
"react-dom": "^17.0.2"
}
Expand Down
10 changes: 7 additions & 3 deletions examples/with-javascript-material-ui/renderer/next.config.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
module.exports = {
webpack: (config) => Object.assign(config, {
target: 'electron-renderer',
}),
webpack: (config, { isServer }) => {
if (!isServer) {
config.target = 'electron-renderer';
}

return config;
},
};
4 changes: 2 additions & 2 deletions examples/with-javascript-tailwindcss/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@
"autoprefixer": "^10.3.1",
"electron": "^13.1.7",
"electron-builder": "^22.11.7",
"next": "^10.2.3",
"nextron": "^6.1.0",
"next": "^11.0.1",
"nextron": "^7.0.0",
"postcss": "^8.3.6",
"react": "^17.0.2",
"react-dom": "^17.0.2",
Expand Down
10 changes: 7 additions & 3 deletions examples/with-javascript-tailwindcss/renderer/next.config.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
module.exports = {
webpack: (config) => Object.assign(config, {
target: 'electron-renderer',
}),
webpack: (config, { isServer }) => {
if (!isServer) {
config.target = 'electron-renderer';
}

return config;
},
};
4 changes: 2 additions & 2 deletions examples/with-javascript/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
"devDependencies": {
"electron": "^13.1.7",
"electron-builder": "^22.11.7",
"next": "^10.2.3",
"nextron": "^6.1.0",
"next": "^11.0.1",
"nextron": "^7.0.0",
"react": "^17.0.2",
"react-dom": "^17.0.2"
}
Expand Down
10 changes: 7 additions & 3 deletions examples/with-javascript/renderer/next.config.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
module.exports = {
webpack: (config) => Object.assign(config, {
target: 'electron-renderer',
}),
webpack: (config, { isServer }) => {
if (!isServer) {
config.target = 'electron-renderer';
}

return config;
},
};
15 changes: 7 additions & 8 deletions examples/with-typescript-ant-design/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,22 +15,21 @@
"electron-store": "^8.0.0"
},
"devDependencies": {
"@babel/core": "^7.13.14",
"@zeit/next-css": "^1.0.1",
"@babel/core": "^7.14.8",
"@types/node": "^14.14.31",
"@types/react": "^16.9.49",
"@babel/preset-typescript": "^7.13.0",
"antd": "^4.15.0",
"@zeit/next-css": "^1.0.1",
"antd": "^4.16.8",
"babel-loader": "^8.2.2",
"babel-plugin-import": "^1.13.3",
"electron": "^13.1.7",
"electron-builder": "^22.11.7",
"next": "^10.2.3",
"nextron": "^6.1.0",
"next": "^11.0.1",
"nextron": "^7.0.0",
"null-loader": "^4.0.1",
"react": "^17.0.2",
"react-dom": "^17.0.2",
"webpack": "4.44.1",
"typescript": "^4.3.5"
"typescript": "^4.3.5",
"webpack": "^4.46.0"
}
}
3 changes: 1 addition & 2 deletions examples/with-typescript-ant-design/renderer/.babelrc
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
{
"presets": [
"next/babel",
"@babel/preset-typescript"
"next/babel"
],
"plugins": [
[
Expand Down
9 changes: 6 additions & 3 deletions examples/with-typescript-ant-design/renderer/next.config.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,17 @@
const withCss = require('@zeit/next-css');

module.exports = withCss({
webpack5: false,
webpack: (config, { isServer }) => {
config.target = 'electron-renderer';
if (!isServer) {
config.target = 'electron-renderer';
}

if (isServer) {
const antStyles = /antd\/.*?\/style\/css.*?/;
const origExternals = [...config.externals];
config.externals = [
(context, request, callback) => {
config.externals = [ // eslint-disable-line
(context, request, callback) => { // eslint-disable-line
if (request.match(antStyles)) return callback();
if (typeof origExternals[0] === 'function') {
origExternals[0](context, request, callback);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ export default class MyDocument extends Document {
<Html>
<Head>
<meta charSet='utf-8' />
<title>Home - Nextron (with-typescript-ant-design)</title>
</Head>
<body>
<Main />
Expand Down
5 changes: 5 additions & 0 deletions examples/with-typescript-ant-design/renderer/pages/home.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import React from 'react';
import Head from 'next/head';
import Link from 'next/link';
import {
Layout,
Expand All @@ -21,6 +22,10 @@ const { Option } = Select;
function Home() {
return (
<React.Fragment>
<Head>
<title>Home - Nextron (with-javascript-ant-design)</title>
</Head>

<Header>
<Link href="/next">
<a>Go to next page</a>
Expand Down
Loading

0 comments on commit d0f13ab

Please sign in to comment.