diff --git a/packages/browserslist-config/index.js b/packages/browserslist-config/index.cjs similarity index 100% rename from packages/browserslist-config/index.js rename to packages/browserslist-config/index.cjs diff --git a/packages/browserslist-config/package.json b/packages/browserslist-config/package.json index d02d231..83b49fb 100644 --- a/packages/browserslist-config/package.json +++ b/packages/browserslist-config/package.json @@ -2,6 +2,7 @@ "name": "@ivuorinen/browserslist-config", "version": "0.2.10", "description": "ivuorinen's shareable configuration for Browserslist.", + "type": "module", "author": { "name": "Ismo Vuorinen", "url": "https://github.com/ivuorinen" @@ -13,9 +14,16 @@ "node": ">=18" }, "files": [ - "index.js", + "index.cjs", + "wrapper.mjs", "scripts/*" ], + "main": "index.cjs", + "module": "wrapper.mjs", + "exports": { + "import": "./wrapper.mjs", + "require": "./index.cjs" + }, "homepage": "https://github.com/ivuorinen/base-configs/tree/main/packages/browserslist-config#readme", "keywords": [ "browserslist-config", @@ -24,7 +32,6 @@ "ivuorinen" ], "license": "MIT", - "main": "index.js", "publishConfig": { "access": "public" }, @@ -33,7 +40,7 @@ "url": "https://github.com/ivuorinen/base-configs.git" }, "scripts": { - "postinstall": "node scripts/postinstall.js" + "postinstall": "node scripts/postinstall.cjs" }, "dependencies": { "@ivuorinen/config-checker": "^1.1.4", diff --git a/packages/browserslist-config/scripts/postinstall.js b/packages/browserslist-config/scripts/postinstall.cjs similarity index 95% rename from packages/browserslist-config/scripts/postinstall.js rename to packages/browserslist-config/scripts/postinstall.cjs index 0682f7d..5a5c02b 100644 --- a/packages/browserslist-config/scripts/postinstall.js +++ b/packages/browserslist-config/scripts/postinstall.cjs @@ -2,6 +2,7 @@ const fs = require('fs') const path = require('path') +// noinspection NpmUsedModulesInstalled const process = require('process') const checkConfig = require('@ivuorinen/config-checker') const foundConfig = checkConfig('browserslist') diff --git a/packages/browserslist-config/wrapper.mjs b/packages/browserslist-config/wrapper.mjs new file mode 100644 index 0000000..16b7e5c --- /dev/null +++ b/packages/browserslist-config/wrapper.mjs @@ -0,0 +1,2 @@ +import config from './index.cjs' +export default config