Skip to content
This repository has been archived by the owner on Feb 1, 2024. It is now read-only.

Commit

Permalink
Merge pull request #2817 from teamleadercrm/revert-remove-cjs
Browse files Browse the repository at this point in the history
Revert removal of CommonJS build
  • Loading branch information
lowiebenoot authored Dec 1, 2023
2 parents 92a57fe + e5ad306 commit 4577fb7
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 10 deletions.
4 changes: 4 additions & 0 deletions .babelrc
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@
"presets": ["@babel/preset-env", "@babel/preset-react", "@babel/preset-typescript"],
"plugins": ["@babel/plugin-transform-runtime"],
"env": {
"cjs": {
"plugins": ["transform-react-remove-prop-types"],
"ignore": ["**/*.stories.tsx", "**/*.spec.tsx", "**/*.spec.ts", "./src/static/**/*"]
},
"es": {
"plugins": ["transform-react-remove-prop-types"],
"presets": [
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
es
cjs
coverage
dist

Expand Down
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@

### Changed

- [BREAKING] Reverted the removal of the CommonJS build from previous version ([@lowiebenoot](https://github.com/lowiebenoot)) in [#2817](https://github.com/teamleadercrm/ui/pull/2817)

### Deprecated

### Removed
Expand Down
6 changes: 2 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,15 +31,13 @@ ReactDOM.render(<Button label="Hello World!" />, document.getElementById('app'))
Import the CSS into your project via JS or CSS.

JS

```js
import '@teamleader/ui/dist/index.css';
import '@teamleader/ui/es/index.css';
```

or CSS

```css
@import url('@teamleader/ui/dist/index.css');
@import url('@teamleader/ui/es/index.css');
```

## Browser support
Expand Down
18 changes: 12 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@teamleader/ui",
"description": "Teamleader UI library",
"version": "24.0.0",
"version": "25.0.0",
"author": "Teamleader <development@teamleader.eu>",
"bugs": {
"url": "https://github.com/teamleadercrm/ui/issues"
Expand All @@ -22,6 +22,8 @@
"Joren Saey <joren.saey@teamleader.eu>"
],
"files": [
"cjs",
"es",
"postcss.config.js",
"dist"
],
Expand Down Expand Up @@ -159,7 +161,8 @@
"ui"
],
"license": "MIT",
"module": "dist/index.js",
"main": "cjs/index.js",
"module": "es/index.js",
"engines": {
"node": "^14.15.0 || >=16"
},
Expand All @@ -168,13 +171,16 @@
"url": "git+https://github.com/teamleadercrm/ui.git"
},
"sideEffects": [
"dist/**/*.css"
"cjs/**/*.css",
"es/**/*.css"
],
"browserslist": ">0.5%, not op_mini all",
"scripts": {
"build:css": "postcss ./src/**/*.css --base src --dir ./dist",
"build:js": "NODE_ENV=es babel src --extensions '.js,.ts,.tsx' --out-dir dist",
"build": "rimraf dist && yarn build-types && yarn build:css && yarn build:js",
"build:css": "postcss ./src/**/*.css --base src --dir ./es && cp -R ./es ./cjs",
"build:js": "yarn build:es; yarn build:cjs",
"build:cjs": "NODE_ENV=cjs babel src --extensions '.js,.ts,.tsx' --out-dir cjs",
"build:es": "NODE_ENV=es babel src --extensions '.js,.ts,.tsx' --out-dir es",
"build": "rimraf es && rimraf cjs && rimraf ./dist/types && yarn build-types && yarn build:css && yarn build:js",
"compile": "storybook build -o dist",
"lint:clean": "yarn lint && rimraf dist",
"deploy:prod": "yarn lint:clean && NODE_ENV=production yarn compile",
Expand Down

0 comments on commit 4577fb7

Please sign in to comment.