Dfx deploy asset upload ignores hidden directories

First off, I’m using https://www.snowpack.dev/ and not Webpack, so I am not bundling everything into one file.

A problem I have run into is that dfx deploy is ignoring hidden directories inside of asset canister upload directories. It will not upload them to the canister. This is causing problems for me when using Snowpack, messing up my import aliases, as I have to alias into the .dfx directory, which is technically hidden. Snowpack takes this directory and potentially builds it and puts it into my asset canister upload directory.

I think it’s unexpected that dfx deploy would ignore hidden directories. For example, git does not ignore hidden directories unless you explicitly ignore those directories. I would expect all directories and files in the asset canister upload directory to be uploaded to the directory, and perhaps to have some sort of ignore configuration for everything else.

1 Like

We’ve got a proposal to add a command to dfx that will generate the interface files and output them into your source code specifically for a nicer setup with bundlers like snowpack.

For now, you can add didc commands to your package.json and get creative with it. Check out the implementation in GitHub - dfinity/internet-identity: Internet Identity, the Single Sign On service for the Internet Computer where we needed to do the same

1 Like

Very nice, I can see what didc is doing. But where can I find and install didc?

I found this page: Neuron/ICP Instructions for Seed Participants :: Internet Computer

That has some information about didc, and I found the repo here: GitHub - dfinity/candid: Candid Library for the Internet Computer

I was able to get it installed

I have been able to get Snowpack to work and I am able to communicate with my canister! Thanks!

I still think hidden files and directories perhaps should not be excluded by default.

Yeah, I can see that going either way. The consequences of accidentally publishing something that was deliberately made secret seem to be a worse outcome to me, personally

1 Like

Another alternative is a way to override that…something like .gitignore, with git nearly everything is included by default and then you specifically exclude. Even if dfx excluded some things by default and allowed the user to explicitly include, that would be nice. But right now there is not way to control that