diff --git a/config/prepareDist.js b/config/prepareDist.js index 5d35465337e..e58cd77c941 100644 --- a/config/prepareDist.js +++ b/config/prepareDist.js @@ -23,6 +23,12 @@ const distRoot = `${__dirname}/../dist`; const packageJson = require('../package.json'); const entryPoints = require('./entryPoints.js'); +// Enable default interpretation of .js files as ECMAScript modules. We don't +// put this in the source ../package.json file because it interferes with tools +// like ts-node, which we use to run various ../config/*.ts scripts. +// TODO(benjamn) Fully diagnose that interference. +packageJson.type = 'module'; + // The root package.json is marked as private to prevent publishing // from happening in the root of the project. This sets the package back to // public so it can be published from the "dist" directory.