-
-
Notifications
You must be signed in to change notification settings - Fork 514
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: esm forge.config.js support (#3358)
* feat: esm forge.config.js support * fix: dynamic import * fix: dynamic import on windows * fix(esm): move config path to local var
- Loading branch information
1 parent
6990f33
commit 563fc17
Showing
8 changed files
with
49 additions
and
4 deletions.
There are no files selected for viewing
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 |
---|---|---|
|
@@ -6,3 +6,4 @@ packages/*/*/doc | |
packages/*/*/index.ts | ||
packages/**/bad.js | ||
tmpl | ||
packages/api/core/helper/dynamic-import.js |
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 @@ | ||
export declare function dynamicImport(path: string): Promise<any>; |
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,5 @@ | ||
const url = require('url'); | ||
|
||
exports.dynamicImport = function dynamicImport(path) { | ||
return import(url.pathToFileURL(path)); | ||
}; |
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 |
---|---|---|
|
@@ -93,6 +93,7 @@ | |
}, | ||
"files": [ | ||
"dist", | ||
"src" | ||
"src", | ||
"helper" | ||
] | ||
} |
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
5 changes: 5 additions & 0 deletions
5
packages/api/core/test/fixture/dummy_default_esm_conf/forge.config.js
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,5 @@ | ||
// eslint-disable-next-line node/no-unsupported-features/es-syntax | ||
export default { | ||
buildIdentifier: 'esm', | ||
defaultResolved: true, | ||
}; |
17 changes: 17 additions & 0 deletions
17
packages/api/core/test/fixture/dummy_default_esm_conf/package.json
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,17 @@ | ||
{ | ||
"name": "", | ||
"productName": "", | ||
"version": "1.0.0", | ||
"description": "", | ||
"main": "src/index.js", | ||
"type": "module", | ||
"scripts": { | ||
"start": "electron-forge start" | ||
}, | ||
"keywords": [], | ||
"author": "", | ||
"license": "MIT", | ||
"devDependencies": { | ||
"electron-prebuilt": "9.9.9" | ||
} | ||
} |