Skip to content
This repository was archived by the owner on Sep 7, 2026. It is now read-only.
This repository was archived by the owner on Sep 7, 2026. It is now read-only.

[Feature] allow copy files before and after webpack build #195

Open

Description

@factoidforrest

My entry point is inside the directory that has been copied. This plugin seems to use the webpack file emit at the end to output the files. Is there a way to do this sooner? Or to somehow target an entrypoint inside the copied directory?

Activity

  1. michael-ciniawsky commented on Dec 18, 2017

    @michael-ciniawsky
    Contributor
    cp src/* dist/* && webpack
    

    Sry, this plugin is an integration of cp for webpack during runs, there is no way to start/use a webpack plugin without actually starting webpack

  2. factoidforrest commented on Dec 18, 2017

    @factoidforrest
    Author

    But you could hook into the compilation process before entrypoints are resolved. I ended up doing it like this:

    const EventHooksPlugin = require('event-hooks-webpack-plugin');
    const fs = require('fs-extra')
    
    //in webpack plugins
          new EventHooksPlugin({
            'before-run': (compilation, done) => {
              console.log('Copying source files to compiled')
              fs.copy('src', 'compiled', done);
            }
          }),
  3. added this to the milestone on Dec 18, 2017
  4. michael-ciniawsky commented on Dec 18, 2017

    @michael-ciniawsky
    Contributor

    Sry, I overread entrypoints :), (maybe) possible, but not supported atm

  5. stereokai commented on Mar 22, 2018

    @stereokai

    @light24bulbs Thank you, your comment helped out a lot!

  6. changed the title [-]Is there a way to make the copy happen before webpack loads the entry points?[/-] [+][Feature] allow copy files before and after webpack build[/+] on Feb 18, 2019
  7. removed this from the 4.6.0 milestone on Feb 18, 2019
  8. appsparkler commented on Mar 26, 2019

    @appsparkler

    @evilebottnawi

    It would be nice to have an option like event (either in options or pattern config) which will decide when the copy is executed.

  9. alexander-akait commented on Mar 26, 2019

    @alexander-akait
    Member

    PR welcome

  10. rburnham52 commented on May 3, 2019

    @rburnham52
  11. Qvatra commented on Jun 28, 2021

    @Qvatra
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Fields

    Priority

    None yet

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions