Skip to content

Commit

Permalink
build common js with babel-plugin-styled-components in core pcln-desi…
Browse files Browse the repository at this point in the history
…gn-system (#1478)
  • Loading branch information
sdalonzo authored Apr 1, 2024
1 parent f8a0979 commit ab36ca9
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 4 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"changes": [
{
"packageName": "pcln-design-system",
"comment": "transpile commonjs output with babel-plugin-styled-components",
"type": "minor"
}
],
"packageName": "pcln-design-system"
}
16 changes: 16 additions & 0 deletions packages/core/babel.config.cjs.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"targets": {
"node": 18
},
"plugins": [
[
"babel-plugin-styled-components",
{
"ssr": true,
"displayName": true,
"pure": true
}
]
],
"presets": ["@babel/preset-env"]
}
9 changes: 5 additions & 4 deletions packages/core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,8 @@
}
],
"sideEffects": false,
"main": "lib-commonjs/index.js",
"module": "dist/index.js",
"main": "dist/cjs/index.js",
"module": "dist/esm/index.js",
"modules.root": "lib",
"typings": "dist/pcln-design-system.d.ts",
"files": [
Expand All @@ -62,9 +62,10 @@
],
"scripts": {
"analyze": "RSDOCTOR=true heft build --production",
"build": "heft test --clean --production && rushx build:babel",
"build": "heft test --clean --production && run-p build:babel:*",
"start": "heft build-watch",
"build:babel": "babel ./lib --out-dir ./dist --ignore '**/*.stories.*,**/*.spec.*,**/*.test.*'",
"build:babel:esm": "babel ./lib --out-dir ./dist/esm --ignore '**/*.stories.*,**/*.spec.*,**/*.test.*'",
"build:babel:cjs": "babel --config-file ./babel.config.cjs.json ./lib --out-dir ./dist/cjs --ignore '**/*.stories.*,**/*.spec.*,**/*.test.*'",
"_phase:build": "heft run --only build -- --clean --production",
"_phase:test": "heft run --only test -- --clean",
"build-only": "heft build --clean",
Expand Down

0 comments on commit ab36ca9

Please sign in to comment.