Skip to content

Commit

Permalink
fix(javascript): use babel plugin for classProperties (#222)
Browse files Browse the repository at this point in the history
  • Loading branch information
shortcuts committed Mar 2, 2022
1 parent 16ba906 commit fe2120b
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 5 deletions.
1 change: 1 addition & 0 deletions clients/algoliasearch-client-javascript/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
},
"devDependencies": {
"@babel/core": "7.17.2",
"@babel/plugin-proposal-class-properties": "7.16.7",
"@babel/plugin-transform-runtime": "7.17.0",
"@babel/preset-env": "7.16.11",
"@babel/runtime": "7.17.2",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,7 @@
"types": "index.d.ts",
"jsdelivr": "dist/algoliasearch.umd.browser.js",
"unpkg": "dist/algoliasearch.umd.browser.js",
"browser": {
"./index.js": "./dist/algoliasearch.cjs.browser.js",
"./lite.js": "./dist/algoliasearch-lite.cjs.browser.js"
},
"browser": "dist/algoliasearch.cjs.browser.js",
"scripts": {
"clean": "rm -rf ./dist"
},
Expand Down
12 changes: 12 additions & 0 deletions clients/algoliasearch-client-javascript/rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,17 @@ packagesConfig.forEach((packageConfig) => {
}),
]
: [];
const clientCommonPlugins =
packageConfig.package === 'client-common'
? [
babel({
babelrc: false,
extensions: ['.ts'],
exclude: 'node_modules/**',
plugins: ['@babel/plugin-proposal-class-properties'],
}),
]
: [];

if (isUmdBuild || isEsmBrowserBuild) {
// eslint-disable-next-line no-param-reassign
Expand All @@ -227,6 +238,7 @@ packagesConfig.forEach((packageConfig) => {
},
},
}),
...clientCommonPlugins,
...transpilerPlugins,
...compressorPlugins,
filesize({
Expand Down
3 changes: 2 additions & 1 deletion yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -615,7 +615,7 @@ __metadata:
languageName: node
linkType: hard

"@babel/plugin-proposal-class-properties@npm:^7.16.7":
"@babel/plugin-proposal-class-properties@npm:7.16.7, @babel/plugin-proposal-class-properties@npm:^7.16.7":
version: 7.16.7
resolution: "@babel/plugin-proposal-class-properties@npm:7.16.7"
dependencies:
Expand Down Expand Up @@ -3524,6 +3524,7 @@ __metadata:
resolution: "algoliasearch-client-javascript@workspace:clients/algoliasearch-client-javascript"
dependencies:
"@babel/core": 7.17.2
"@babel/plugin-proposal-class-properties": 7.16.7
"@babel/plugin-transform-runtime": 7.17.0
"@babel/preset-env": 7.16.11
"@babel/runtime": 7.17.2
Expand Down

0 comments on commit fe2120b

Please sign in to comment.