-
-
Notifications
You must be signed in to change notification settings - Fork 171
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Added electron builder config function (#221)
* Added electron builder config function * Moved config to seperate file * Moved electron builder config into seperate ts file * Removed unneeded source map support
- Loading branch information
1 parent
377b0eb
commit c4cf411
Showing
8 changed files
with
68 additions
and
35 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,7 +8,6 @@ | |
"out", | ||
"*.js", | ||
"scheme.json", | ||
"electron-builder.yml", | ||
"tsconfig-base.json", | ||
"vendor" | ||
], | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import { readJson } from "fs-extra-p" | ||
import { Lazy } from "lazy-val" | ||
import * as path from "path" | ||
import { orNullIfFileNotExist } from "./util" | ||
import { getConfig } from "read-config-file" | ||
|
||
export { ElectronWebpackConfiguration } from "./core" | ||
|
||
export async function getPackageMetadata() { | ||
const projectDir = process.cwd() | ||
return await orNullIfFileNotExist(readJson(path.join(projectDir, "package.json"))) | ||
} | ||
|
||
export async function getElectronWebpackConfig() { | ||
const projectDir = process.cwd() | ||
const packageMetadata = await getPackageMetadata() | ||
const electronWebpackConfig = ((await getConfig({ | ||
packageKey: "electronWebpack", | ||
configFilename: "electron-webpack", | ||
projectDir, | ||
packageMetadata: new Lazy(() => Promise.resolve(packageMetadata)) | ||
})) || {} as any).result || {} | ||
return electronWebpackConfig | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
import { getElectronWebpackConfig } from "./config" | ||
|
||
export default async function() { | ||
const electronWebpackConfig = await getElectronWebpackConfig() | ||
return { | ||
extraMetadata: { | ||
main: "main.js" | ||
}, | ||
files: [ | ||
{ | ||
from: ".", | ||
filter: ["package.json"] | ||
}, | ||
{ | ||
from: electronWebpackConfig.commonDistDirectory + "/main" | ||
}, | ||
{ | ||
from: electronWebpackConfig.commonDistDirectory + "/renderer" | ||
}, | ||
{ | ||
from: electronWebpackConfig.commonDistDirectory + "/renderer-dll" | ||
} | ||
], | ||
extraResources: [ | ||
{ | ||
from: "static", | ||
to: "static" | ||
} | ||
] | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters