-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This is to resolve the error where winston was being being included in various webpack bundles. We change the `main` entry point of the `@percy/agent` package so only the file that's ready for a browser is bundled. Then we transpile that file fully with babel and rollup so their webpack config isn't looking to compile it too. This solves percy/percy-cypress#58 fully.
- Loading branch information
Showing
7 changed files
with
1,298 additions
and
53 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 |
---|---|---|
@@ -0,0 +1,10 @@ | ||
{ | ||
"presets": [ | ||
"@babel/env", | ||
"@babel/typescript" | ||
], | ||
"plugins": [ | ||
"@babel/proposal-class-properties", | ||
"@babel/proposal-object-rest-spread" | ||
] | ||
} |
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 |
---|---|---|
|
@@ -5,3 +5,4 @@ | |
.percy.pid | ||
/tmp/* | ||
/dist-test | ||
/.rpt2_cache |
Large diffs are not rendered by default.
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
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,26 @@ | ||
import commonjs from "rollup-plugin-commonjs"; | ||
import resolve from "rollup-plugin-node-resolve"; | ||
import babel from "rollup-plugin-babel"; | ||
import pkg from "./package.json"; | ||
|
||
export default { | ||
input: "src/percy-agent-client/index.ts", | ||
output: { | ||
name: "PercyAgent", | ||
file: pkg.browser, | ||
format: "umd" | ||
}, | ||
plugins: [ | ||
// Allows node_modules resolution | ||
resolve({ extensions: [".ts"] }), | ||
|
||
// Allow bundling cjs modules. Rollup doesn't understand cjs | ||
commonjs(), | ||
|
||
// Compile TypeScript/JavaScript files | ||
babel({ | ||
extensions: [".ts"], | ||
include: ["src/**"] | ||
}) | ||
] | ||
}; |
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 |
---|---|---|
|
@@ -14,5 +14,9 @@ | |
}, | ||
"include": [ | ||
"./src/**/*" | ||
], | ||
"exclude": [ | ||
"node_modules", | ||
"dist" | ||
] | ||
} |