-
-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: support ESM config files (#414)
Uses `import` for dynamic module imports allowing you to use ESM as a config file. Also lets you return a function that returns a promise to get the config in case you need to do some async work to retrieve it from somewhere. Fixes #413
- Loading branch information
1 parent
bb33080
commit 3f731c8
Showing
6 changed files
with
101 additions
and
7 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 |
---|---|---|
|
@@ -13,3 +13,4 @@ node_modules | |
coverage.lcov | ||
yarn-error.log | ||
dist | ||
.tmp |
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,10 @@ | ||
const path = require('path') | ||
|
||
export default { | ||
buildSWConfig: { | ||
inject: [path.join(__dirname, 'sw-globals.js')], | ||
}, | ||
afterTests: () => { | ||
console.log('AFTER') | ||
} | ||
} |
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,12 @@ | ||
const path = require('path') | ||
|
||
export default function () { | ||
return { | ||
buildSWConfig: { | ||
inject: [path.join(__dirname, 'sw-globals.js')], | ||
}, | ||
afterTests: () => { | ||
console.log('AFTER') | ||
} | ||
} | ||
} |
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,10 @@ | ||
const path = require('path') | ||
|
||
export default Promise.resolve({ | ||
buildSWConfig: { | ||
inject: [path.join(__dirname, 'sw-globals.js')], | ||
}, | ||
afterTests: () => { | ||
console.log('AFTER') | ||
} | ||
}) |
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