Code Monkey home page Code Monkey logo

Comments (6)

vladshcherbin avatar vladshcherbin commented on May 31, 2024 1

@riccardonuzz update rollup-plugin-delete to 1.1.0 and you can solve it this way:

plugins: [
  copy({ ..., hook: 'buildStart' }),
  del({ ..., hook: 'buildEnd' })
]

from rollup-plugin-copy.

marverix avatar marverix commented on May 31, 2024

I don't know if it will help you but in https://github.com/marverix/rollup-plugin-copier you have option hookOn available.

from rollup-plugin-copy.

vladshcherbin avatar vladshcherbin commented on May 31, 2024

In 1.0.0 files are correctly copied in sequential async generateBundle hook. Other plugins will have access to files when placed after copy plugin so text replacement or other transformations can be done there.

Try the new version to see if it fits your needs 😉

from rollup-plugin-copy.

riccardonuzz avatar riccardonuzz commented on May 31, 2024

I'm using rollup-plugin-delete and placing it after copy plugin but I'm unable to delete files in dist folder. It looks like del plugin runs always before copy plugin.

from rollup-plugin-copy.

vladshcherbin avatar vladshcherbin commented on May 31, 2024

@riccardonuzz yes, delete plugin uses buildStart hook and copy uses buildEnd hook so no matter what order you place plugins, delete will run first, then copy.

There is an option hook where you can set what hook to use, you can try to set it to options hook which is executed before buildStart so delete hook will be executed after copy. (don't try to set it to buildStart and rely on plugins order, this hook runs plugins in parallel and it's a small limitation of current rollup plugin system)

I'll add a hook option to delete plugin too, so you can change it for this case:

  • copy - buildStart hook
  • delete - buildEnd hook

from rollup-plugin-copy.

riccardonuzz avatar riccardonuzz commented on May 31, 2024

Problem solved, thank you! :)

from rollup-plugin-copy.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.