feat!: module & commonjs in browserslist

BREAKING CHANGE: support module, and commonjs types
This commit is contained in:
Ismo Vuorinen
2024-08-21 17:38:30 +03:00
parent 2de156e2c0
commit 93ea840406
4 changed files with 13 additions and 3 deletions

View File

@@ -2,6 +2,7 @@
"name": "@ivuorinen/browserslist-config", "name": "@ivuorinen/browserslist-config",
"version": "0.2.10", "version": "0.2.10",
"description": "ivuorinen's shareable configuration for Browserslist.", "description": "ivuorinen's shareable configuration for Browserslist.",
"type": "module",
"author": { "author": {
"name": "Ismo Vuorinen", "name": "Ismo Vuorinen",
"url": "https://github.com/ivuorinen" "url": "https://github.com/ivuorinen"
@@ -13,9 +14,16 @@
"node": ">=18" "node": ">=18"
}, },
"files": [ "files": [
"index.js", "index.cjs",
"wrapper.mjs",
"scripts/*" "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", "homepage": "https://github.com/ivuorinen/base-configs/tree/main/packages/browserslist-config#readme",
"keywords": [ "keywords": [
"browserslist-config", "browserslist-config",
@@ -24,7 +32,6 @@
"ivuorinen" "ivuorinen"
], ],
"license": "MIT", "license": "MIT",
"main": "index.js",
"publishConfig": { "publishConfig": {
"access": "public" "access": "public"
}, },
@@ -33,7 +40,7 @@
"url": "https://github.com/ivuorinen/base-configs.git" "url": "https://github.com/ivuorinen/base-configs.git"
}, },
"scripts": { "scripts": {
"postinstall": "node scripts/postinstall.js" "postinstall": "node scripts/postinstall.cjs"
}, },
"dependencies": { "dependencies": {
"@ivuorinen/config-checker": "^1.1.4", "@ivuorinen/config-checker": "^1.1.4",

View File

@@ -2,6 +2,7 @@
const fs = require('fs') const fs = require('fs')
const path = require('path') const path = require('path')
// noinspection NpmUsedModulesInstalled
const process = require('process') const process = require('process')
const checkConfig = require('@ivuorinen/config-checker') const checkConfig = require('@ivuorinen/config-checker')
const foundConfig = checkConfig('browserslist') const foundConfig = checkConfig('browserslist')

View File

@@ -0,0 +1,2 @@
import config from './index.cjs'
export default config