You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The driver bundle is one big jar containing all the drivers for every supported platform. This makes it quite large, roughly 117 MB for v1.29.0.
The "driver-bundle" artifact could be changed to be only a very small artifact with runtime dependencies for each driver and platform. This would allow users to exclude drivers and platforms they don't need. For example, if someone only needs Chromium on Windows x86-64, Maven's method of excluding dependencies could be used to reduce the download size.
So, in the future, one could have a variant of "driver-bundle" that includes only the shared parts for all drivers and depends on "driver-chromium" (with shared parts for each platform), "driver-chromium-linux" (Linux parts only), and "driver-chromium-windows" (Windows parts only). "driver-chromium-linux" may also depend on "chromium-linux-x86-64" and "chromium-linux-arm64".
We contemplated having some filters for the driver deps in the past but were not satisfied with the mechanisms that Maven provides for defining platform-specific modules. Using exclusion in the client config sounds like an interesting alternative. It seems to be breaking what the package author assumes about the dependencies, so I'm not 100% sure we want to recommend that. I'll keep this request open to collect more feedback.
Note also that we only bundle driver binaries which include node executable and relevant playwright node.js code. All browsers are downloaded separately and only include those that are required for the host platform. See this page for more information on how playwright manages browser downloads.
For the time being you have to options to mitigate the proble:
Use preinstalled driver and configure the path via system property or
Configure playwright to use your own implementation of the Driver loader.
Thanks, I am overall happy with how Playwright works.
If you add the dependencies in "driver-bundle" as follows, then nothing changes for the users. "driver-bundle" is still sufficient as dependency and the new platform-specific dependencies are automatically loaded as transitive dependencies. The only difference is that now you have the possibility to exclude the unnecessary platform-specific dependencies. This would also be interesting for Node.js, where you have the possibility to use your own pre-installed version of Node.js since #1016. Especially in CI environments, where the images may already have Node.js, browser and drivers installed, this is a useful feature to save traffic and time.
<project>
<parent>
<groupId>com.microsoft.playwright</groupId>
<artifactId>parent-pom</artifactId>
<version>x.y.z</version>
</parent>
<artifactId>driver-bundle</artifactId>
<dependencies>
<dependency>
<groupId>com.microsoft.playwright</groupId>
<artifactId>driver</artifactId>
<version>${project.version}</version>
<scope>compile</scope>
</dependency>
<!-- new platform specific stuff comes here -->
<dependency>
<groupId>com.microsoft.playwright</groupId>
<artifactId>driver-node-mac</artifactId>
<version>${project.version}</version>
<scope>runtime</scope>
</dependency>
<!-- new platform specific stuff ends here -->
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-engine</artifactId>
</dependency>
</dependencies>
</project>
+1 here, bumping to version 1.55.0 has pushed us over the 512MB JAR limit for deploying to Beanstalk Java environment
val playwrightDriverBundle by configurations.creating {
isCanBeConsumed = false
isCanBeResolved = true
}
implementation("com.microsoft.playwright:playwright:1.55.0")
// Pull the driver-bundle artifact only for selective unpacking in bootJar
playwrightDriverBundle("com.microsoft.playwright:driver-bundle:1.55.0")
// Configure bootJar to replace the full driver-bundle with a filtered version
tasks.named<BootJar>("bootJar") {
val bundleProvider =
provider {
configurations
.named("playwrightDriverBundle")
.get()
.files
.first { it.extension == "jar" }
}
// Exclude the original full driver-bundle JAR from BOOT-INF/lib
exclude { fileTreeElement ->
fileTreeElement.path.contains("driver-bundle") && fileTreeElement.path.endsWith(".jar")
}
// Repack driver-bundle with only Mac and Linux drivers into BOOT-INF/lib
from(provider { zipTree(bundleProvider.get()) }) {
// Include all class files and META-INF (keeps DriverJar and other classes)
include("com/**")
include("META-INF/**")
// Include only Mac and Linux platform drivers
include("driver/mac/**")
include("driver/linux/**")
// Exclude documentation
exclude("driver/**/README*", "driver/**/LICENSE*", "driver/**/NOTICE*")
includeEmptyDirs = false
into("BOOT-INF/classes/")
}
}
Another +1. driver-bundle-1.53.0.jar is 194MB and only going to go up. We only run on mac-arm64 and linux, we don't need linux-arm64 or win32_x64 in there!
The driver packaging has been reworked to make the bundled Node.js optional.
What changed (#1936, ships in the next release): the platform-independent driver code (the playwright-core package) now lives in the driver artifact, while driver-bundle holds only the Node.js binaries.
There are now two ways to slim down the driver footprint, and I'd like to hear which fits your setup:
1. Bring your own Node.js (available now). If a Node.js is present on the host, set PLAYWRIGHT_NODEJS_PATH and exclude driver-bundle — no Node.js binaries are downloaded at all (~190 MB saved):
2. Per-platform split (in progress, #1935). driver-bundle is split per OS/arch so a build automatically pulls only the Node.js for its own platform (~1/5 of the current size) — zero config, no external Node.js needed.
Which would work better for you — relying on a preinstalled Node.js, or having the build bundle just your platform's Node.js automatically? Other scenarios welcome too.
Since v1.61 (#1936), the platform-independent driver code ships in the driver artifact and driver-bundle only contains the Node.js binaries. If Node.js is available on the host, exclude driver-bundle and set PLAYWRIGHT_NODEJS_PATH to skip downloading Node.js entirely (see the comment above).
Activity
yury-s commentedon Feb 6, 2023
We contemplated having some filters for the driver deps in the past but were not satisfied with the mechanisms that Maven provides for defining platform-specific modules. Using
exclusionin the client config sounds like an interesting alternative. It seems to be breaking what the package author assumes about the dependencies, so I'm not 100% sure we want to recommend that. I'll keep this request open to collect more feedback.Note also that we only bundle driver binaries which include node executable and relevant playwright node.js code. All browsers are downloaded separately and only include those that are required for the host platform. See this page for more information on how playwright manages browser downloads.
For the time being you have to options to mitigate the proble:
sephiroth-j commentedon Feb 7, 2023
Thanks, I am overall happy with how Playwright works.
If you add the dependencies in "driver-bundle" as follows, then nothing changes for the users. "driver-bundle" is still sufficient as dependency and the new platform-specific dependencies are automatically loaded as transitive dependencies. The only difference is that now you have the possibility to exclude the unnecessary platform-specific dependencies. This would also be interesting for Node.js, where you have the possibility to use your own pre-installed version of Node.js since #1016. Especially in CI environments, where the images may already have Node.js, browser and drivers installed, this is a useful feature to save traffic and time.
lin-mt commentedon Sep 5, 2023
The current docker image is too large, and we only need to use chrome.
Tsyklop commentedon Dec 25, 2023
I have multimodule project.
I solve this problem with next trick:
Createed module without java code. Added playwright dependency and
maven-assembly-plugin.Added
assembly.xmlfor maven plugin:Excluded what I do not need.
Excluded playwright dependencies from
spring-boot-maven-plugin.Added new module to main module dependencies list.
My final jar file reduced size from 200 MB to 60 MB
iaculch commentedon Oct 24, 2025
+1 here, bumping to version 1.55.0 has pushed us over the 512MB JAR limit for deploying to Beanstalk Java environment
PhilipMorby commentedon Jan 22, 2026
Another +1. driver-bundle-1.53.0.jar is 194MB and only going to go up. We only run on mac-arm64 and linux, we don't need linux-arm64 or win32_x64 in there!
yury-s commentedon Jun 19, 2026
The driver packaging has been reworked to make the bundled Node.js optional.
What changed (#1936, ships in the next release): the platform-independent driver code (the
playwright-corepackage) now lives in thedriverartifact, whiledriver-bundleholds only the Node.js binaries.There are now two ways to slim down the driver footprint, and I'd like to hear which fits your setup:
1. Bring your own Node.js (available now). If a Node.js is present on the host, set
PLAYWRIGHT_NODEJS_PATHand excludedriver-bundle— no Node.js binaries are downloaded at all (~190 MB saved):2. Per-platform split (in progress, #1935).
driver-bundleis split per OS/arch so a build automatically pulls only the Node.js for its own platform (~1/5 of the current size) — zero config, no external Node.js needed.Which would work better for you — relying on a preinstalled Node.js, or having the build bundle just your platform's Node.js automatically? Other scenarios welcome too.
yury-s commentedon Oct 14, 2026
Since v1.61 (#1936), the platform-independent driver code ships in the
driverartifact anddriver-bundleonly contains the Node.js binaries. If Node.js is available on the host, excludedriver-bundleand setPLAYWRIGHT_NODEJS_PATHto skip downloading Node.js entirely (see the comment above).