browserify / browserify/static-module

Transform which ran with v1 not working with v3

Open
#48 16 comments 4 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
75
Forks
22
PR merge metrics
No merged PRs in 30d

Description

Hi! [cwise](https://github.com/scijs/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](https://github.com/scijs/cwise/blob/master/lib/cwise-transform.js) 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](https://github.com/scijs/cwise/pull/25#issuecomment-442942342).

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

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.