Created
May 18, 2021 23:34
-
-
Save bendemboski/05d00b3f95e7ce8b720b22d161fa5d28 to your computer and use it in GitHub Desktop.
Webpack config to make ember-cli-page-object work with embroider optimized
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
module.exports = { | |
module: { | |
rules: [ | |
// ember-cli-page-object's compatiblity module is a wrapper around | |
// @ember/test-helpers that synthesizes its methods using older APIs when | |
// in an app with an old/missing version of @ember/test-helpers. The | |
// dynamic-ness disagrees with embroider's staticAddonTestSupportTrees | |
// flag, so since we know we will only run in environments with a | |
// sufficiently new @ember/test-helpers, string-replace the compatiblity | |
// module to statically re-export @ember/test-helpers, and also to export | |
// the named wait helper, which was an older name for settled() (and will | |
// never actually be called anyway). | |
{ | |
test: /\/ember-cli-page-object\/test-support\/-private\/compatibility\.js$/, | |
loader: 'string-replace-loader', | |
options: { | |
search: /^[\s\S]+$/, | |
replace: [ | |
"export * from '@ember/test-helpers';", | |
"export { settled as wait } from '@ember/test-helpers';", | |
].join('\n'), | |
strict: true, | |
}, | |
}, | |
], | |
}, | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment