stencil
stencil copied to clipboard
Configuration: Copy Tasks are not executed for dev builds with target 'dist'
Stencil version:
@stencil/[email protected]
I'm submitting a: [x] bug report
Current behavior: Copy Tasks (outputTargets) are not run for development builds with target 'dist'.
Expected behavior:
Copy Tasks should be executed for development builds with target 'dist'. If this is not the intended behaviour, it should be clearly documented under copy-tasks.
Steps to reproduce:
- Create a
stencil.config.tssimilar to this:
export const config: Config = {
outputTargets: [{
type: 'dist', // make sure target is set to 'dist'
copy: [{ src: '../somefile.json' }],
}],
...
};
- Make a 'full' build:
npx stencil build
Check the dist/ folder for somefile.json - it's there.
Note that the file is being copied according to the build log!
- Now run a development build:
npx stencil build --dev
Check the dist/ folder again - the file is gone!
Note that the file is not being copied according to the build log!
Other information:
Doesn't seem to affect www targets, only dist ?
I believe this behaviour has changed a while back and is probably related to this code which seems to silently return before executing the copy tasks.
https://github.com/ionic-team/stencil/blob/65006a1c0484c7048b30e26814cddc73cfc8afba/src/compiler/build/build.ts#L37
The above mentioned changes were part of the v1.11.0 release on March 20. I have verified that the problem does not exist in v1.10.3.
I can confirm that this issue still exists in v1.11.3 and v1.14.0 as well for the dist output target. www copies just fine.
I can confirm that this issue still exists in v1.11.3 and v1.14.0 as well for the
distoutput target.wwwcopies just fine.
This is my experience as well.
Updated Other information:
Doesn't seem to affect www targets, only dist ?
On 1.14 dist copy task works fine. The trick in the relativity of the folders
copy: [{src: 'assets', dest: '../mylib/assets'}],
This will copy /src/assets into /dist/mylib/assets. So for dist task try to use dest setting
I can confirm that this issue still exists in v1.11.3 and v1.14.0 as well for the
distoutput target.wwwcopies just fine.
@nedredmond : Just out of curiosity, do you copy anything from above the "current working directory" level?
I.e: copy: [{ src: '../foo.bar' }]
ah I am facing this too. angularOutputTarget folder not generated for dev mode either strange
On 1.14
distcopy task works fine. The trick in the relativity of the folderscopy: [{src: 'assets', dest: '../mylib/assets'}],This will copy/src/assetsinto/dist/mylib/assets. So fordisttask try to usedestsetting
Thank you @Jagget. This was the issue for me.