Packaging: How to export an imported module?

I’m writing a package, and in one of the modules, I would like e.g, Plots to be available to the user. However, I simply failed to do that.

import Plots as P

module mylibrary
export P

end

In particular, compilation error happens.

  1. It should probably be
module mylibrary
import Plots as P
export P
end
  1. I am not sure one can export a module.
2 Likes

Have you checked Reexport.jl? https://github.com/simonster/Reexport.jl

It worked!