Skip to content

bug: Asset Copying Issue Folder Structure Flattened in Version 4.21.0 #5983

Closed

Description

@luisbytes

Prerequisites

Stencil Version

4.21.0

Current Behavior

Files in subfolders, like assets/icons/home.svg, are copied to the top-level folder (assets/home.svg), losing the original folder structure.

Expected Behavior

The folder structure should be preserved, so assets/icons/home.svg should remain in assets/icons/home.svg.

System Info

System: node 20.15.0
    Platform: darwin (22.6.0)
   CPU Model: Apple M1 Pro (10 cpus)
    Compiler: /node_modules/.pnpm/@[email protected]/node_modules/@stencil/core/compiler/stencil.js
       Build: 1724698030
     Stencil: 4.21.0 🐷
  TypeScript: 5.5.3
      Rollup: 2.56.3
      Parse5: 7.1.2
      jQuery: 4.0.0-pre
      Terser: 5.31.1

Steps to Reproduce

  1. Create a subfolder inside assets (e.g., assets/icons/).
  2. Place a file in that subfolder (e.g., assets/icons/home.svg).
  3. Build with version 4.21.0.
  4. Observe that the file is copied to assets/home.svg instead of assets/icons/home.svg.

Code Reproduction URL

https://github.com/ionic-team/stencil

Additional Information

Activity

  1. tanner-reits commented on Sep 12, 2024

    @tanner-reits
    Contributor

    @luisbytes I've confirmed the issue here. In fact, I think this was causing some issues for us in Ionic Framework recently. I'll get this in our backlog so we can take a closer look. Thanks for linking those other issues as well!

  2. added
    Bug: Validated
    and removed on Sep 12, 2024
  3. changed the title [-]bug: Asset Copying Issue Folder Structure Flattened in Version 2.21.0[/-] [+]bug: Asset Copying Issue Folder Structure Flattened in Version 4.21.0[/+] on Sep 12, 2024
  4. Loic57 commented on Sep 17, 2024

    @Loic57

    @luisbytes @tanner-reits Same issue here.
    It looks like there is a new prop keepDirStructure for the copy task.
    I used it and everything was fixed : https://stenciljs.com/docs/copy-tasks#keepdirstructure

  5. luisbytes commented on Sep 17, 2024

    @luisbytes
    Author

    @Loic57 Apparently this solution only applies when using Copy Task in my particular case, I am using assetsdirs

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Bug: Validated

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions