Skip to content

webpack require #596

Description

@fraxken

Not sure if we can work around that to avoid flagging it as unsafe-import

/* globals __non_webpack__require__ */
 
const realImport = new Function('modulePath', 'return import(modulePath)')
 
function realRequire(modulePath) {
  if (typeof __non_webpack__require__ === 'function') {
    return __non_webpack__require__(modulePath)
  }
 
  return require(modulePath)
}
 
module.exports = { realImport, realRequire }

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions