Heavy-flavour quarks, due to their large masses, are produced in the early stages of the relativistic hadronic collisions via hard scattering processes. Therefore, they are ideal probes to investigate the properties of the Quark-Gluon Plasma (QGP) produced in ultra-relativistic heavy-ion collisions, since they experience the full system evolution.
In this contribution, the latest results on heavy-flavour jet production measured with the ALICE detector in pp and p--Pb collisions from the LHC Run 2 data are reported. In particular, measurements of heavy-flavour decay-electron jets in pp collisions at $\sqrt{s}$ = 5.02 TeV and in p--Pb collisions at $\sqrt{s_\mathrm{NN}}$ = 5.02 TeV as well as of D-meson tagged jet in pp collisions at $\sqrt{s}$ = 5.02, 7 TeV and in p--Pb collisions at $\sqrt{s_\mathrm{NN}}$ = 5.02 TeV are presented. The latter includes also studies on the jet momentum fraction carried by the D meson. Moreover, a characterisation of the spatial profile and of the internal composition of the charm jet by means of the azimuthal correlations of D-mesons with charged particles in pp and in p--Pb collisions at center-of-mass energy of 5.02 TeV is reported.