Skip to content

ignoring node_modules #839

@jlongster

Description

@jlongster

I'm sure this has been talked about before, but I can't find a clear issue for it. I'm playing around with using webpack with server-side node modules (using target: node). I started to like the idea of bundling of everything into a single js file because that would be cool for deployment, but what kills that idea is binary dependencies. They definitely can't be bundled in, though you might know of a hack that lets me alias them or something.

Is there any way to tell the system ignore bundling anything coming from node_modules, and just leave it as a require statement?

I don't know if the IgnorePlugin means that, but if so, trying it results in an error: plugins: [ new webpack.IgnorePlugin(/.*/, /.*node_modules.*/) ]

% webpack --config webpack.node.config.js

/Users/james/projects/jlongster4/node_modules/webpack/lib/Compilation.js:203
                factory.create(module.context, dependencies[0], function(err, dependantModul
                                     ^
TypeError: Cannot read property 'context' of null
    at Tapable.<anonymous> (/Users/james/projects/jlongster4/node_modules/webpack/lib/Compilation.js:203:24)

Metadata

Metadata

Assignees

No one assigned

    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