Skip to content

Commit

Permalink
convert lib/core-server to be build using tsup
Browse files Browse the repository at this point in the history
  • Loading branch information
ndelangen committed Sep 28, 2022
1 parent 9b8d33d commit 485f38c
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 5 deletions.
30 changes: 26 additions & 4 deletions code/lib/core-server/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,22 @@
"url": "https://opencollective.com/storybook"
},
"license": "MIT",
"main": "dist/cjs/index.js",
"module": "dist/esm/index.js",
"types": "dist/types/index.d.ts",
"exports": {
".": {
"require": "./dist/index.js",
"import": "./dist/index.mjs",
"types": "./dist/index.d.ts"
},
"./standalone": {
"require": "./dist/standalone.js",
"import": "./dist/standalone.mjs",
"types": "./dist/standalone.d.ts"
},
"./package.json": "./package.json"
},
"main": "dist/index.js",
"module": "dist/index.mjs",
"types": "dist/index.d.ts",
"files": [
"dist/**/*",
"public/**/*",
Expand All @@ -30,7 +43,7 @@
],
"scripts": {
"check": "../../../scripts/node_modules/.bin/tsc --noEmit",
"prep": "node ../../../scripts/prepare.js"
"prep": "../../../scripts/prepare/bundle.ts"
},
"dependencies": {
"@aw-web-design/x-default-browser": "1.4.88",
Expand Down Expand Up @@ -101,5 +114,14 @@
"publishConfig": {
"access": "public"
},
"bundler": {
"platform": "node",
"entries": [
"./src/index.ts",
"./src/standalone.ts",
"./src/presets/babel-cache-preset.ts",
"./src/presets/common-preset.ts"
]
},
"gitHead": "fc90fc875462421c1faa35862ac4bc436de8e75f"
}
6 changes: 5 additions & 1 deletion code/lib/core-server/src/utils/server-statics.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,11 @@ import favicon from 'serve-favicon';

import { dedent } from 'ts-dedent';

const defaultFavIcon = require.resolve('@storybook/core-server/public/favicon.ico');
const defaultFavIcon = path.join(
path.dirname(require.resolve('@storybook/core-server/package.json')),
'public',
'favicon.ico'
);

export async function useStatics(router: any, options: Options) {
let hasCustomFavicon = false;
Expand Down

0 comments on commit 485f38c

Please sign in to comment.