Partially.
Packages still need to be backwards compatible, so the final linked version (try view-source on a package’s JS in 1.3) is still an IIFE with regular Meteor imports (Package global, local vars for file-level “globals”), etc.
However, if your package doesn’t use the old API - api.use()/export() - and instead relies solely on import and export, I think you’ll be ok. I never tried though
It will still be inside an IIFE and you might need to stub a Package global to avoid a ReferenceError, but it uses the new meteorInstall for deps, which is based on CommonJS - each file is wrapped in a function(require,exports,module) and receives deps via this require.
Check out e.g.
- the GitHub - benjamn/install: Minimal JavaScript module loader · GitHub npm module (see README)
- and https://github.com/meteor/meteor/tree/release-1.3/packages/modules that uses it
- view-source as per @goatic (generated by tools/isobuild/linker.js)
However, see also:
i.e. MDG doesn’t want to be tied to CommonJS in the long term.