ionic-team / stencil

A toolchain for building scalable, enterprise-ready component systems on top of TypeScript and Web Component standards. Stencil components can be distributed natively to React, Angular, Vue, and traditional web developers from a single, framework-agnostic codebase.
https://stenciljs.com
Other
12.5k stars 783 forks source link

Copy task with target "assets" makes internal copy fail #1845

Open bitflower opened 5 years ago

bitflower commented 5 years ago

Stencil version:

 @stencil/core@1.3.2

I'm submitting a:

[x] bug report [ ] feature request [ ] support request => Please do not submit support requests here, use one of these channels: https://stencil-worldwide.herokuapp.com/ or https://forum.ionicframework.com/

Current behavior: Once you specify a copy task for www with target assets the internal asset copy task is not being executed resulting in missing files in www/assets.

It's all described in the issue repo here: https://github.com/bitflower/stencil-asset-copy-issue

Expected behavior: Internal copy tasks is still executed.

Thanks guys, keep it up!

bitflower commented 5 years ago

A workaround seems to be:

const copiedFiles: any[] = [
  {
    // Workaround is to add dest property to all items with target "dest"
    src: 'assets',
    dest: 'assets'
  },
  {
    src: '../node_modules/some/deep/nested/source-folder',
    dest: 'assets'
  }
];
bitflower commented 5 years ago

Ok, there's still some issue when multiple sources contain equally named folder for example fonts inside assets. Only one of them survives...

mburger81 commented 5 years ago

Yes, I figured out, if your have two components with the same assetsDir like assets, the are overwritten and at the end you have only once bundled.

bitflower commented 5 years ago

Yes, something needs to get a little smarter here. My workaround doesn't fully work so I have to investigate here anyway soon.

LalitKushwah commented 4 years ago

@bitflower @mburger81 If you do not mention the copy configuration for assets directory isn't it getting copied to www. I guess it should be you don't need to provide any config for assets directory by default stencil copies that folder.