Skip to content

Commit

Permalink
fix: build cjs with interop: auto
Browse files Browse the repository at this point in the history
  • Loading branch information
spawnia committed Feb 2, 2024
1 parent 72525f9 commit f59d0f3
Show file tree
Hide file tree
Showing 4 changed files with 1,969 additions and 1,952 deletions.
1 change: 1 addition & 0 deletions babel.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ module.exports = {
'babel-plugin-styled-components',
'@babel/plugin-transform-runtime',
[
// https://4x.ant.design/docs/react/getting-started#Import-on-Demand
'import',
{
libraryName: 'antd',
Expand Down
16 changes: 8 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -59,20 +59,20 @@
"react-image-size": "^2.0.0"
},
"devDependencies": {
"@babel/core": "^7.23.6",
"@babel/eslint-parser": "^7.23.3",
"@babel/plugin-transform-runtime": "^7.23.6",
"@babel/preset-env": "^7.23.6",
"@babel/core": "^7.23.9",
"@babel/eslint-parser": "^7.23.10",
"@babel/plugin-transform-runtime": "^7.23.9",
"@babel/preset-env": "^7.23.9",
"@babel/preset-react": "^7.23.3",
"@babel/runtime": "^7.23.6",
"@babel/runtime": "^7.23.9",
"@mll-lab/eslint-config": "^3.1.0",
"@mll-lab/eslint-plugin": "^1.3.4",
"@mll-lab/prettier-config": "^1.0.0",
"@mll-lab/tsconfig": "^3.0.0",
"@rollup/plugin-babel": "^6.0.4",
"@rollup/plugin-commonjs": "^25.0.7",
"@rollup/plugin-node-resolve": "^15.2.3",
"@rollup/plugin-typescript": "^11.1.5",
"@rollup/plugin-typescript": "^11.1.6",
"@semantic-release/changelog": "^6.0.3",
"@semantic-release/git": "^10.0.1",
"@storybook/addon-essentials": "^7.5.3",
Expand Down Expand Up @@ -116,7 +116,7 @@
"react-hotkeys": "^2.0.0",
"react-is": "^18.2.0",
"require-from-string": "^2.0.2",
"rollup": "^4.5.1",
"rollup": "^4.9.6",
"rollup-plugin-peer-deps-external": "^2.2.4",
"rollup-plugin-styles": "^4.0.0",
"semantic-release": "^22.0.8",
Expand All @@ -129,5 +129,5 @@
"typescript": "^5.3.2",
"webpack": "^5.89.0"
},
"packageManager": "yarn@4.0.2"
"packageManager": "yarn@4.1.0"
}
8 changes: 7 additions & 1 deletion rollup.config.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import babel from '@rollup/plugin-babel';
import { babel } from '@rollup/plugin-babel';
import commonjs from '@rollup/plugin-commonjs';
import resolve from '@rollup/plugin-node-resolve';
import typescript from '@rollup/plugin-typescript';
Expand All @@ -16,6 +16,9 @@ export default {
file: pkg.main,
format: 'cjs',
sourcemap: true,
// https://rollupjs.org/configuration-options/#output-interop
// Necessary in order for jest in consumers to work
interop: 'auto',
},
{
file: pkg.module,
Expand All @@ -33,6 +36,9 @@ export default {
// 9: var __decorate = this && this.__decorate || function (decorators, target, key, desc) {
context: 'this',

// https://www.npmjs.com/package/@rollup/plugin-babel#babelhelpers
external: [/@babel\/runtime/],

plugins: [
peerDepsExternal(),
resolve(),
Expand Down
Loading

0 comments on commit f59d0f3

Please sign in to comment.