Importing from a local file vs. address

Currently, during development, I have to import from local files; e.g.:

import NonFungibleToken from "../contracts/NonFungibleToken.cdc"

But this causes errors during deployment. The workaround I currently have is:

import NonFungibleToken from 0x631e88ae7f1d7c20

But this causes errors during development (with the VSCode extension, for example).

Is there something Iā€™m missing? Do I need to change every file I write every time I deploy to testnet?

Hi @nick I advise you to use Flow CLI deploy funcionality. You can read more about it here: Deploy a Flow Project - Flow Documentation.

It will allow you to deploy contracts with a single command flow project deploy and to define import that will work in IDE.

Got it, thanks!

@sideninja Btw, how does this work with transactions?