Copy-webpack-plugin: Can I run a copy task after another copy task?

Created on 24 Oct 2018  路  4Comments  路  Source: webpack-contrib/copy-webpack-plugin

By looking at the source code, it is found that the tasks in the current patterns are all running in parallel, but I have a special requirement. I want to run another task after one task is finished. Can this be done with this plugin?

new CopyWebpackPlugin([
      {
        from: path.resolve(__dirname, '../src/muya/themes'), // task 1
        to: path.join(__dirname, '../static/themes'),
        force: true
      },
      {
        from: path.join(__dirname, '../static'), // task 2
        to: path.join(__dirname, '../dist/electron/static'),
        ignore: ['.*']
      }
    ]),

I want to task 2 run after task 1.

Needs more info

Most helpful comment

@evilebottnawi

  1. Build app into /dist.
  2. Copy static files into /dist.
  3. Copy /dist folder into /docs to update GitHub Pages.

All 4 comments

@Jocs No, it is very strange if you want to copy one task after another, can you show real use case?

@evilebottnawi

  1. Build app into /dist.
  2. Copy static files into /dist.
  3. Copy /dist folder into /docs to update GitHub Pages.

@Ohar it is feature, feel free to send a PR, we need hook on done event

Close in favor https://github.com/webpack-contrib/copy-webpack-plugin/issues/318 (see https://github.com/webpack-contrib/copy-webpack-plugin/issues/318#issuecomment-458909457)

Was this page helpful?
0 / 5 - 0 ratings

Related issues

BoldBigflank picture BoldBigflank  路  6Comments

alex88 picture alex88  路  4Comments

niksmac picture niksmac  路  3Comments

nickenchev picture nickenchev  路  3Comments

richmeij picture richmeij  路  5Comments