Skip to content

How can I copy files from a directory without it creating the whole source structure? #293

@charliedavison

Description

@charliedavison

I'm trying to use CopyWebpackPlugin to copy some files out of my node_modules folder and into my build folder.

new CopyWebpackPlugin([
     { from: 'node_modules/accounting/**', to: 'vendor/npm/' },
     { from: 'node_modules/angular/**', to: 'vendor/npm/' },

I would expect this to output to my build folder /build/vendor/npm/accounting and build/vendor/npm/angular respectively, but instead a node_modules folder is created - the files are actually outputted to build/vendor/npm/node_modules/accounting.

How can I prevent the node_modules folder being created and get my expected output?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No 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