diff --git a/.eslintrc.js b/.eslintrc.cjs similarity index 100% rename from .eslintrc.js rename to .eslintrc.cjs diff --git a/.size-limit.js b/.size-limit.cjs similarity index 55% rename from .size-limit.js rename to .size-limit.cjs index 2ec5fcb..801f9bc 100644 --- a/.size-limit.js +++ b/.size-limit.cjs @@ -3,8 +3,4 @@ module.exports = [ path: 'artifacts/dist/index.js', limit: '500 B', }, - { - path: 'artifacts/dist/index.es.js', - limit: '500 B', - }, ] diff --git a/Makefile b/Makefile index d994a64..79ec2ea 100644 --- a/Makefile +++ b/Makefile @@ -17,7 +17,7 @@ website-%: ################################################################################ -artifacts/dist: rollup.config.js tsconfig.json node_modules $(JS_SOURCE_FILES) - node_modules/.bin/rollup --config rollup.config.js - +artifacts/dist: tsconfig.build.json node_modules $(JS_SOURCE_FILES) + @rm -rf "$@" + node_modules/.bin/tsc -p "$<" @touch "$@" diff --git a/docs/prettier.config.js b/docs/prettier.config.cjs similarity index 100% rename from docs/prettier.config.js rename to docs/prettier.config.cjs diff --git a/jest.config.js b/jest.config.js index 6c86bb9..10e057b 100644 --- a/jest.config.js +++ b/jest.config.js @@ -1 +1 @@ -module.exports = require('@snout/jest-config') +export {default} from '@snout/jest-config' diff --git a/package.json b/package.json index 8fbb7b7..238bf91 100644 --- a/package.json +++ b/package.json @@ -16,12 +16,11 @@ "publishConfig": { "access": "public" }, + "type": "module", "main": "artifacts/dist/index.js", - "module": "artifacts/dist/index.es.js", "typings": "artifacts/dist/index.d.ts", "exports": { - "import": "./artifacts/dist/index.es.js", - "require": "./artifacts/dist/index.js" + ".": "./artifacts/dist/index.js" }, "sideEffects": false, "files": [ @@ -31,18 +30,17 @@ "node": ">=14" }, "scripts": { - "prepublishOnly": "rollup --config rollup.config.js", - "size-limit-build": "rollup --config rollup.config.js", + "prepublishOnly": "tsc -p tsconfig.build.json", + "size-limit-build": "tsc -p tsconfig.build.json", "size-limit-clean": "rm -rf artifacts/dist" }, "dependencies": { - "@snout/regexp": "^0.2.1" + "@snout/regexp": "^0.3.0" }, "devDependencies": { "@size-limit/preset-small-lib": "^5.0.3", "@snout/eslint-config": "^2.0.0", - "@snout/jest-config": "^1.0.2", - "@snout/rollup-config": "^1.1.2", + "@snout/jest-config": "^2.1.0", "@snout/tsconfig": "^1.0.3", "@typescript-eslint/eslint-plugin": "^4.18.0", "@typescript-eslint/parser": "^4.18.0", diff --git a/rollup.config.js b/rollup.config.js deleted file mode 100644 index 4fbece9..0000000 --- a/rollup.config.js +++ /dev/null @@ -1,4 +0,0 @@ -import {createConfig} from '@snout/rollup-config' -import packageJson from './package.json' - -export default createConfig(packageJson) diff --git a/src/types.ts b/src/types.d.ts similarity index 100% rename from src/types.ts rename to src/types.d.ts diff --git a/tsconfig.build.json b/tsconfig.build.json new file mode 100644 index 0000000..f8f2beb --- /dev/null +++ b/tsconfig.build.json @@ -0,0 +1,9 @@ +{ + "extends": "./tsconfig.json", + "compilerOptions": { + "outDir": "artifacts/dist", + }, + "include": [ + "src/**/*" + ] +}