Skip to content

Commit

Permalink
tempting fate with an export shakeup
Browse files Browse the repository at this point in the history
  • Loading branch information
kwhitley committed Jun 14, 2023
1 parent 44e7204 commit fe34a34
Show file tree
Hide file tree
Showing 2 changed files with 67 additions and 13 deletions.
69 changes: 66 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,72 @@
{
"name": "itty-router",
"version": "4.0.9",
"version": "4.0.10",
"description": "A tiny, zero-dependency router, designed to make beautiful APIs in any environment.",
"type": "module",
"main": "./index.js",
"main": "./dist/index.cjs.js",
"module": "./dist/index.js",
"exports": {
".": {
"import": "./dist/index.js",
"require": "./dist/index.cjs.js"
},
"./createCors": {
"import": "./dist/createCors.js",
"require": "./dist/createCors.cjs.js"
},
"./createResponse": {
"import": "./dist/createResponse.js",
"require": "./dist/createResponse.cjs.js"
},
"./error": {
"import": "./dist/error.js",
"require": "./dist/error.cjs.js"
},
"./html": {
"import": "./dist/html.js",
"require": "./dist/html.cjs.js"
},
"./jpeg": {
"import": "./dist/jpeg.js",
"require": "./dist/jpeg.cjs.js"
},
"./png": {
"import": "./dist/png.js",
"require": "./dist/png.cjs.js"
},
"./Router": {
"import": "./dist/Router.js",
"require": "./dist/Router.cjs.js"
},
"./status": {
"import": "./dist/status.js",
"require": "./dist/status.cjs.js"
},
"./text": {
"import": "./dist/text.js",
"require": "./dist/text.cjs.js"
},
"./webp": {
"import": "./dist/webp.js",
"require": "./dist/webp.cjs.js"
},
"./websocket": {
"import": "./dist/websocket.js",
"require": "./dist/websocket.cjs.js"
},
"./withContent": {
"import": "./dist/withContent.js",
"require": "./dist/withContent.cjs.js"
},
"./withCookies": {
"import": "./dist/withCookies.js",
"require": "./dist/withCookies.cjs.js"
},
"./withParams": {
"import": "./dist/withParams.js",
"require": "./dist/withParams.cjs.js"
}
},
"keywords": [
"api",
"router",
Expand All @@ -30,7 +93,7 @@
"prerelease": "yarn verify",
"prebuild": "rimraf dist && mkdir dist && yarn coverage && yarn format",
"build": "rollup -c",
"release": "release --tag --push --patch --src=dist",
"release": "release --tag --push --type=next",
"runtime:bun": "bun example/bun.ts",
"runtime:node": "node example/node.js"
},
Expand Down
11 changes: 1 addition & 10 deletions rollup.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import terser from '@rollup/plugin-terser'
import typescript from '@rollup/plugin-typescript'
import { globby } from 'globby'
import bundleSize from 'rollup-plugin-bundle-size'
import copy from 'rollup-plugin-copy'

export default async () => {
const files = await globby('./src/*.ts', {
Expand All @@ -21,22 +20,14 @@ export default async () => {
},
{
format: 'cjs',
file: path.replace('/src/', '/dist/cjs/').replace('.ts', '.js'),
file: path.replace('/src/', '/dist/').replace('.ts', '.cjs.js'),
// sourcemap: true,
},
],
plugins: [
typescript({ sourceMap: false }),
terser(),
bundleSize(),
copy({
targets: [
{
src: ['CONTRIBUTING.md', 'CODE-OF-CONDUCT.md', 'LICENSE'],
dest: 'dist',
},
],
}),
],
}))
}

0 comments on commit fe34a34

Please sign in to comment.