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 #2809 from teamleadercrm/remove-cjs-build
Browse files Browse the repository at this point in the history
[FRONT-117] Remove cjs build
lowiebenoot authored Nov 29, 2023
2 parents 0c71974 + 8e65aca commit 572ceb0
Showing 5 changed files with 13 additions and 18 deletions.
4 changes: 0 additions & 4 deletions .babelrc
Original file line number Diff line number Diff line change
@@ -2,10 +2,6 @@
"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": [
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
es
cjs
coverage
dist

4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -4,10 +4,14 @@

### Changed

- [BREAKING] The ES Modules build has been moved to the dist folder, so you now need update the css import to `@teamleader/ui/dist/index.css` ([@lowiebenoot](https://github.com/lowiebenoot)) in [#2809](https://github.com/teamleadercrm/ui/pull/2809)

### Deprecated

### Removed

- [BREAKING] The CommonJS build has been removed. We now only have an ES Modules build. ([@lowiebenoot](https://github.com/lowiebenoot)) in [#2809](https://github.com/teamleadercrm/ui/pull/2809)

## [23.2.0] - 2023-11-14

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

JS

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

or CSS

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

## Browser support
16 changes: 5 additions & 11 deletions package.json
Original file line number Diff line number Diff line change
@@ -22,8 +22,6 @@
"Joren Saey <joren.saey@teamleader.eu>"
],
"files": [
"cjs",
"es",
"postcss.config.js",
"dist"
],
@@ -161,8 +159,7 @@
"ui"
],
"license": "MIT",
"main": "cjs/index.js",
"module": "es/index.js",
"module": "dist/index.js",
"engines": {
"node": "^14.15.0 || >=16"
},
@@ -171,16 +168,13 @@
"url": "git+https://github.com/teamleadercrm/ui.git"
},
"sideEffects": [
"cjs/**/*.css",
"es/**/*.css"
"dist/**/*.css"
],
"browserslist": ">0.5%, not op_mini all",
"scripts": {
"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",
"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",
"compile": "storybook build -o dist",
"lint:clean": "yarn lint && rimraf dist",
"deploy:prod": "yarn lint:clean && NODE_ENV=production yarn compile",

0 comments on commit 572ceb0

Please sign in to comment.