Stable memory flag

The option is an option to the moc compiler, not dfx. For dfx, you can specify moc options in an “args” entry for the canister in dfx.json. Sorry, I don’t have an example to hand.

And yes, you can use both stable variables and ESM.mo in the same canister, including pre/post upgrade methods.

I think the example above even does that if you look carefully.