Skip to content

Commit

Permalink
build icon with swc (#2726)
Browse files Browse the repository at this point in the history
  • Loading branch information
denkristoffer authored and Lelith committed Oct 23, 2024
1 parent 9e83b23 commit 0f1ea18
Show file tree
Hide file tree
Showing 4 changed files with 47 additions and 4 deletions.
1 change: 1 addition & 0 deletions .changeset/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
}
],
"ignore": [
"@contentful/f36-icon",
"@contentful/f36-icons",
"@contentful/f36-avatar",
"@contentful/f36-image",
Expand Down
18 changes: 18 additions & 0 deletions packages/components/icon/.srwrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"jsc": {
"parser": {
"syntax": "typescript",
"tsx": true
},
"target": "es2020",
"loose": false,
"minify": {
"compress": false,
"mangle": false
}
},
"module": {
"type": "es6"
},
"minify": false
}
22 changes: 18 additions & 4 deletions packages/components/icon/package.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
{
"name": "@contentful/f36-icon",
"version": "5.0.0-alpha.0",
"version": "5.0.0-alpha.1",
"description": "Forma 36: Icon component",
"license": "MIT",
"scripts": {
"build": "tsup"
"build": "npm run build:esm && npm run build:cjs && npm run build:types",
"build:cjs": "swc ./src -d ./dist/cjs --strip-leading-paths -C module.type=commonjs",
"build:esm": "swc ./src -d ./dist/esm --strip-leading-paths",
"build:types": "tsc --outDir ./dist/types --emitDeclarationOnly"
},
"dependencies": {
"@contentful/f36-core": "^4.74.1",
Expand All @@ -13,13 +16,24 @@
"emotion": "^10.0.17"
},
"devDependencies": {
"react-icons": "^4.4.0",
"@contentful/f36-icons-v4": "npm:@contentful/f36-icons@^4.0.0"
"@contentful/f36-icons-v4": "npm:@contentful/f36-icons@^4.0.0",
"@swc/cli": "^0.3.12",
"@swc/core": "^1.4.14",
"react-icons": "^4.4.0"
},
"peerDependencies": {
"react": ">=16.8",
"react-dom": ">=16.8"
},
"exports": {
".": {
"types": "./dist/types/index.d.ts",
"import": "./dist/esm/index.js",
"require": "./dist/cjs/index.js",
"default": "./dist/esm/index.js"
},
"./package.json": "./package.json"
},
"files": [
"dist"
],
Expand Down
10 changes: 10 additions & 0 deletions packages/components/icon/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"extends": "../../../tsconfig.json",
"include": ["src"],
"exclude": ["dist/**/*"],
"compilerOptions": {
"allowJs": false,
"declaration": true,
"noEmit": false,
},
}

0 comments on commit 0f1ea18

Please sign in to comment.