Skip to content

Commit

Permalink
fix: Expose PercyAgent as a global always (#178)
Browse files Browse the repository at this point in the history
Second time is the charm right? We're going to beta test this one but
it should do it. Setting `extend: true` in the rollup config allows
the bundler to extend the global namespace (window).

So the output now looks like `this.PercyAgent = ` (where `this` is the
window object)

I cut a beta release of this and tested it on the various SDKs (btw, we need a better process for this):

- https://github.com/percy/percy-cypress/compare/rd/agent-beta-4.4
- https://github.com/percy/percy-puppeteer/compare/rd/agent-beta-4.4
- https://github.com/percy/percy-nightwatch/compare/rd/agent-beta-4.4
- https://github.com/percy/percy-webdriverio/compare/rd/agent-beta-4.4
- https://github.com/percy/percy-nightmare/compare/rd/agent-beta-4.4
- https://github.com/percy/percy-protractor/compare/rd/agent-beta-4.4
- https://github.com/percy/percy-capybara/compare/rd/agent-beta-4.4

This one should do the trick 👍
  • Loading branch information
Robdel12 authored May 3, 2019
1 parent b827d4f commit 698067b
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@ export default {
output: {
name: "PercyAgent",
file: "dist/public/percy-agent.js",
format: "umd"
format: "iife",
// a must to add `PercyAgent` to the global namespace
extend: true
},
plugins: [
// Allows node_modules resolution
Expand Down

0 comments on commit 698067b

Please sign in to comment.