diff --git a/packages/uni-nvue-styler/api-extractor.json b/packages/uni-nvue-styler/api-extractor.json new file mode 100644 index 0000000000000000000000000000000000000000..c18cb2ed32a791bb90f48caadfa54f2d5dc5db14 --- /dev/null +++ b/packages/uni-nvue-styler/api-extractor.json @@ -0,0 +1,8 @@ +{ + "extends": "../../api-extractor.json", + "mainEntryPointFilePath": "./dist/packages//src/index.d.ts", + "dtsRollup": { + "publicTrimmedFilePath": "./dist/.d.ts" + } + } + \ No newline at end of file diff --git a/packages/uni-nvue-styler/build.json b/packages/uni-nvue-styler/build.json new file mode 100644 index 0000000000000000000000000000000000000000..263af45c58278a7f97871a8ecf064ab55717b0af --- /dev/null +++ b/packages/uni-nvue-styler/build.json @@ -0,0 +1,15 @@ +[ + { + "input": { + "src/esm.ts": ["dist/uni-nvue-styler.es.js"] + } + }, + { + "input": { + "src/index.ts": ["dist/uni-nvue-styler.cjs.js"] + }, + "compilerOptions": { + "declaration": true + } + } +] diff --git a/packages/uni-nvue-styler/package.json b/packages/uni-nvue-styler/package.json index 9a7c342354e4bc8dbc7269a673d4f509d084c3fb..6a258e9a77cf93e2bacd77bcde0d83bca92519dc 100644 --- a/packages/uni-nvue-styler/package.json +++ b/packages/uni-nvue-styler/package.json @@ -2,8 +2,9 @@ "name": "@dcloudio/uni-nvue-styler", "version": "0.0.1-nvue3.3030820220125001", "description": "uni-nvue-styler", - "main": "dist/index.js", - "types": "dist/index.d.ts", + "main": "./dist/uni-nvue-styler.cjs.js", + "module": "./dist/uni-nvue-styler.es.js", + "types": "./dist/uni-nvue-styler.d.ts", "files": [ "dist" ], diff --git a/packages/uni-nvue-styler/src/esm.ts b/packages/uni-nvue-styler/src/esm.ts new file mode 100644 index 0000000000000000000000000000000000000000..c487347fde79e612905aef4cd663154056d23c12 --- /dev/null +++ b/packages/uni-nvue-styler/src/esm.ts @@ -0,0 +1,2 @@ +export { expand } from './expand' +export { normalize } from './normalize' diff --git a/packages/uni-nvue-styler/src/expand/font.ts b/packages/uni-nvue-styler/src/expand/font.ts index 1f5b1ecdd582d0061cc974f2ae3d9b995af4471d..c5627c90b02a4a57baa93c5ba73eb63a8ece2c02 100644 --- a/packages/uni-nvue-styler/src/expand/font.ts +++ b/packages/uni-nvue-styler/src/expand/font.ts @@ -1,5 +1,5 @@ import parseCSSFont, { ISystemFont, IFont } from 'parse-css-font' -import { Declaration } from 'postcss' +import type { Declaration } from 'postcss' import { createDecl, TransformDecl } from '../utils' export const transformFont: TransformDecl = (decl) => { diff --git a/packages/uni-nvue-styler/src/expand/index.ts b/packages/uni-nvue-styler/src/expand/index.ts index 96bd38de00f86e5ec24eb603756527fbaedc1cb5..1968e09f832ce03d441105d7e1c7dacdcdcd6019 100644 --- a/packages/uni-nvue-styler/src/expand/index.ts +++ b/packages/uni-nvue-styler/src/expand/index.ts @@ -26,10 +26,13 @@ const DeclTransforms: Record = { 'border-color': transformBorderColor, 'border-radius': transformBorderRadius, 'flex-flow': transformFlexFlow, - font: transformFont, background: transformBackground, } +if (__NODE_JS__) { + DeclTransforms.font = transformFont +} + const expanded = Symbol('expanded') export const expand: Plugin = { postcssPlugin: 'nvue:expand', diff --git a/packages/uni-nvue-styler/tsconfig.json b/packages/uni-nvue-styler/tsconfig.json index 98dd51629984c0a0040e34967c911f65a62bdf12..aac3fa9bf1f140ce60321e2d26b40dd17a90bf0e 100644 --- a/packages/uni-nvue-styler/tsconfig.json +++ b/packages/uni-nvue-styler/tsconfig.json @@ -1,11 +1,24 @@ { - "extends": "../../tsconfig.node.json", "compilerOptions": { - "outDir": "dist" + "outDir": "dist", + "sourceMap": false, + "declaration": true, + "declarationDir": "./dist/packages/uni-nvue-styler/src", + "target": "es2015", + "module": "esnext", + "moduleResolution": "node", + "allowJs": false, + "strict": true, + "noUnusedLocals": true, + "experimentalDecorators": true, + "resolveJsonModule": true, + "esModuleInterop": true, + "removeComments": false, + "lib": ["ESNext", "DOM"] }, "include": [ "src", - "types/shims.d.ts", + "../global.d.ts", "../shims-node.d.ts", "../shims-uni-app.d.ts" ]