From 9b1546f131772185b3d39d18b6e57dc41ff5c7ca Mon Sep 17 00:00:00 2001 From: Jorge del Casar <948953+jorgecasar@users.noreply.github.com> Date: Sun, 4 Apr 2021 10:51:09 +0200 Subject: [PATCH] fix: generate esm correctly (#5087) --- babel.config.js | 7 ++++++- packages/netlify-cms-app/package.json | 1 + packages/netlify-cms/package.json | 1 + 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/babel.config.js b/babel.config.js index b7c1efbf..ff109df5 100644 --- a/babel.config.js +++ b/babel.config.js @@ -88,7 +88,12 @@ const svgo = { function presets() { return [ '@babel/preset-react', - '@babel/preset-env', + [ + '@babel/preset-env', + { + modules: isESM ? false : 'auto', + }, + ], [ '@emotion/babel-preset-css-prop', { diff --git a/packages/netlify-cms-app/package.json b/packages/netlify-cms-app/package.json index 3cd7b995..deda3fb8 100644 --- a/packages/netlify-cms-app/package.json +++ b/packages/netlify-cms-app/package.json @@ -5,6 +5,7 @@ "homepage": "https://www.netlifycms.org", "repository": "https://github.com/netlify/netlify-cms/tree/master/packages/netlify-cms-app", "bugs": "https://github.com/netlify/netlify-cms/issues", + "module": "dist/esm/index.js", "main": "dist/netlify-cms-app.js", "files": [ "src/", diff --git a/packages/netlify-cms/package.json b/packages/netlify-cms/package.json index 55c76678..e814d839 100644 --- a/packages/netlify-cms/package.json +++ b/packages/netlify-cms/package.json @@ -5,6 +5,7 @@ "homepage": "https://www.netlifycms.org", "repository": "https://github.com/netlify/netlify-cms", "bugs": "https://github.com/netlify/netlify-cms/issues", + "module": "dist/esm/index.js", "main": "dist/netlify-cms.js", "scripts": { "webpack": "node --max_old_space_size=4096 ../../node_modules/webpack/bin/webpack.js",