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

[FRONT-117] Remove cjs build #2809

Merged
merged 4 commits into from
Nov 29, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions .babelrc
Original file line number Diff line number Diff line change
Expand Up @@ -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": [
Expand Down
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

Expand Down
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
16 changes: 5 additions & 11 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,6 @@
"Joren Saey <[email protected]>"
],
"files": [
"cjs",
"es",
"postcss.config.js",
"dist"
],
Expand Down Expand Up @@ -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"
},
Expand All @@ -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",
Expand Down