Skip to content

Commit

Permalink
fix(examples): Update next.config.js for production build #403
Browse files Browse the repository at this point in the history
  • Loading branch information
saltyshiomix committed Sep 21, 2023
1 parent b5edf46 commit 7cd277e
Show file tree
Hide file tree
Showing 16 changed files with 52 additions and 7 deletions.
2 changes: 1 addition & 1 deletion examples/_template/js/main/background.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ if (isProd) {
});

if (isProd) {
await mainWindow.loadURL('app://./home.html');
await mainWindow.loadURL('app://./home');
} else {
const port = process.argv[2];
await mainWindow.loadURL(`http://localhost:${port}/home`);
Expand Down
2 changes: 1 addition & 1 deletion examples/_template/ts/main/background.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ if (isProd) {
});

if (isProd) {
await mainWindow.loadURL('app://./home.html');
await mainWindow.loadURL('app://./home');
} else {
const port = process.argv[2];
await mainWindow.loadURL(`http://localhost:${port}/home`);
Expand Down
4 changes: 4 additions & 0 deletions examples/basic-javascript/renderer/next.config.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
module.exports = {
trailingSlash: true,
images: {
unoptimized: true,
},
webpack: (config, { isServer }) => {
if (!isServer) {
config.target = 'electron-renderer'
Expand Down
4 changes: 4 additions & 0 deletions examples/basic-typescript/renderer/next.config.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
module.exports = {
trailingSlash: true,
images: {
unoptimized: true,
},
webpack: (config, { isServer }) => {
if (!isServer) {
config.target = 'electron-renderer'
Expand Down
4 changes: 4 additions & 0 deletions examples/custom-build-options/renderer/next.config.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
module.exports = {
trailingSlash: true,
images: {
unoptimized: true,
},
webpack: (config, { isServer }) => {
if (!isServer) {
config.target = 'electron-renderer'
Expand Down
4 changes: 4 additions & 0 deletions examples/custom-main-entry/renderer/next.config.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
module.exports = {
trailingSlash: true,
images: {
unoptimized: true,
},
webpack: (config, { isServer }) => {
if (!isServer) {
config.target = 'electron-renderer'
Expand Down
4 changes: 4 additions & 0 deletions examples/custom-renderer-port/renderer/next.config.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
module.exports = {
trailingSlash: true,
images: {
unoptimized: true,
},
webpack: (config, { isServer }) => {
if (!isServer) {
config.target = 'electron-renderer'
Expand Down
2 changes: 1 addition & 1 deletion examples/ipc-communication/main/background.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ if (isProd) {
})

if (isProd) {
await mainWindow.loadURL('app://./home.html')
await mainWindow.loadURL('app://./home')
} else {
const port = process.argv[2]
await mainWindow.loadURL(`http://localhost:${port}/home`)
Expand Down
4 changes: 4 additions & 0 deletions examples/ipc-communication/renderer/next.config.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
module.exports = {
trailingSlash: true,
images: {
unoptimized: true,
},
webpack: (config, { isServer }) => {
if (!isServer) {
config.target = 'electron-renderer';
Expand Down
2 changes: 1 addition & 1 deletion examples/store-data/main/background.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ if (isProd) {
})

if (isProd) {
await mainWindow.loadURL('app://./home.html')
await mainWindow.loadURL('app://./home')
} else {
const port = process.argv[2]
await mainWindow.loadURL(`http://localhost:${port}/home`)
Expand Down
4 changes: 4 additions & 0 deletions examples/store-data/renderer/next.config.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
module.exports = {
trailingSlash: true,
images: {
unoptimized: true,
},
webpack: (config, { isServer }) => {
if (!isServer) {
config.target = 'electron-renderer'
Expand Down
4 changes: 4 additions & 0 deletions examples/with-ant-design/renderer/next.config.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
module.exports = {
trailingSlash: true,
images: {
unoptimized: true,
},
webpack: (config, { isServer }) => {
if (!isServer) {
config.target = 'electron-renderer'
Expand Down
7 changes: 4 additions & 3 deletions examples/with-chakra-ui/renderer/next.config.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
module.exports = {
trailingSlash: true,
images: {
unoptimized: true,
},
webpack: (config, { isServer }) => {
if (!isServer) {
config.target = 'electron-renderer'
}

return config
},
images: {
unoptimized: true,
},
}
4 changes: 4 additions & 0 deletions examples/with-emotion/renderer/next.config.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
module.exports = {
trailingSlash: true,
images: {
unoptimized: true,
},
webpack: (config, { isServer }) => {
if (!isServer) {
config.target = 'electron-renderer'
Expand Down
4 changes: 4 additions & 0 deletions examples/with-material-ui/renderer/next.config.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
module.exports = {
trailingSlash: true,
images: {
unoptimized: true,
},
webpack: (config, { isServer }) => {
if (!isServer) {
config.target = 'electron-renderer'
Expand Down
4 changes: 4 additions & 0 deletions examples/with-tailwindcss/renderer/next.config.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
module.exports = {
trailingSlash: true,
images: {
unoptimized: true,
},
webpack: (config, { isServer }) => {
if (!isServer) {
config.target = 'electron-renderer'
Expand Down

0 comments on commit 7cd277e

Please sign in to comment.