Give an argument to await chromium.executablePath which would specify where binaries are located. For example await chromium.executablePath("./bin").
Why would it be useful?
I'm bundling this library with webpack and in the end I have 1 file, but from the source code I can see that binaries are located path.join(__dirname, "..", "bin") which requires me to submit to this contract. Instead I would like to create a layer or give my own path to binaries.
To create the final dist directory for lambda I'm also using copy plugin to copy binaries to dist directory.
In webpack configuration I'm creating parent directory only to support path.join(__dirname, "..", "bin") contract.
const webpack = require("webpack");
const CopyPlugin = require("copy-webpack-plugin");
module.exports = () => {
return {
entry: {
"api-handler": "./src/handler.ts",
},
target: "node",
mode: "production",
module: {
rules: [
{
test: /\.ts$/,
use: "ts-loader",
exclude: /node_modules/,
},
],
},
resolve: {
extensions: [".ts", ".mjs", ".js"],
},
plugins: [
new webpack.IgnorePlugin({
// this is another issue with this package
resourceRegExp: /.*\.js\.map$/,
}),
new CopyPlugin({
patterns: [
{
from: "node_modules/@sparticuz/chrome-aws-lambda/bin/",
to: "async-handler/bin/",
},
{
from: "node_modules/@sparticuz/chrome-aws-lambda/bin/",
to: "api-handler/bin/",
},
],
}),
],
output: {
libraryTarget: "commonjs",
filename: "[name]/src/index.js",
clean: true,
},
};
};
What would you like to have implemented?
Give an argument to
await chromium.executablePath
which would specify where binaries are located. For exampleawait chromium.executablePath("./bin")
.Why would it be useful?
I'm bundling this library with webpack and in the end I have 1 file, but from the source code I can see that binaries are located
path.join(__dirname, "..", "bin")
which requires me to submit to this contract. Instead I would like to create a layer or give my own path to binaries.To create the final dist directory for lambda I'm also using copy plugin to copy binaries to dist directory.
In webpack configuration I'm creating parent directory only to support
path.join(__dirname, "..", "bin")
contract.Huge thanks for maintaining this library.
Cheers, Arturs