Skip to content

Why does require return an empty object? #411

@janhancic

Description

@janhancic

I was trying to use showdown with webpack.

Showdown has this node specific code, and it failed as webpack returned an empty object for the var fs = require('fs'); call. Why is that so? Shouldn't it return null or undefined?

I can appreciate that Showdown wasn't written with webpack in mind, but I imagine there is lot's of code out there, doing the same exact thing.

So, do I need to patch showdown, or is there some change in webpack that will solve this? Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions