static-module
static-module copied to clipboard
Transform which ran with v1 not working with v3
Hi! cwise has had some long-running issues/PRs to upgrade its usage of static-module and get rid of some security warnings, but it seems that the particular usage static-module is no longer functioning under static-module 3.*.
The cwise transform finds references to var cwise = require('cwise'); cwise({...})
and replaces them with evaluated code.
I'm guessing a bit, but it seems like maybe the usage as a bare function require as opposed to properties on the require (i.e. require('cwise')(...)
as opposed to require('fs).readFileSync(...)
) are not working.
FWIW, the transform has not changed and so does still function and get triggered correctly.
I've detailed a test case here.
Glad to debug a bit further, but I'd thought I'd check to see if this might just need a small API usage update instead of involved debugging. Thanks!
/cc @archmoj @etpinard