Force use of a specific prebuild binary
jagu-sayan opened this issue · 1 comments
Hello,
I am on OS X and I want to build my project with a iltorb linux prebuild. Because sometimes, I manually deploy my project on a linux server.
I don't find an easy way to do that :/
I also use webpack with this config to use iltorb:
{
module : {
rules : [{
// Load brotli binary (in ./node_modules/iltorb/build/bindings/iltorb.node)
test : /\.(node)$/,
use : [{
loader : "file-loader",
}]
}]
}
}
I'm not exactly sure how iltorb
is being used in your project or why that rule is required in webpack. As with any native module, .node
binaries are either downloaded (if pre-built binaries are available) or compiled for your environment.
Typically there should be a build process as part of the deployment process that should handle installing dependencies and handling any additional assets bundling. Copying node_modules
directory isn't advised unless the build is done in an environment that's similar to the production environment. In this case, it isn't recommended because the binary compiled for OSX shouldn't work on Linux.