Skip to content

Commit

Permalink
[compiler] Add babel-plugin-idx to snap
Browse files Browse the repository at this point in the history
To surface any potential conflicts with this plugin, let's install it
into snap so we can surface any runtime errors after compilation

ghstack-source-id: 545eee6fb7f6401e919422581cf64070da581d50
Pull Request resolved: #30434
  • Loading branch information
poteto committed Jul 23, 2024
1 parent fc74a3a commit 08b4ee8
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 1 deletion.
1 change: 1 addition & 0 deletions compiler/packages/snap/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
"@babel/preset-typescript": "^7.18.6",
"@parcel/watcher": "^2.1.0",
"@testing-library/react": "^13.4.0",
"babel-plugin-idx": "^3.0.3",
"babel-plugin-syntax-hermes-parser": "^0.15.1",
"chalk": "4",
"fbt": "^1.0.0",
Expand Down
7 changes: 6 additions & 1 deletion compiler/packages/snap/src/compiler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,11 @@ function getEvaluatorPresets(
): Array<BabelCore.PluginItem> {
const presets: Array<BabelCore.PluginItem> = [
{
plugins: ['babel-plugin-fbt', 'babel-plugin-fbt-runtime'],
plugins: [
'babel-plugin-fbt',
'babel-plugin-fbt-runtime',
'babel-plugin-idx',
],
},
];
presets.push(
Expand Down Expand Up @@ -365,6 +369,7 @@ export async function transformFixtureInput(
[plugin, options],
'babel-plugin-fbt',
'babel-plugin-fbt-runtime',
'babel-plugin-idx',
],
sourceType: 'module',
ast: includeEvaluator,
Expand Down
5 changes: 5 additions & 0 deletions compiler/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3768,6 +3768,11 @@ babel-plugin-fbt@^1.0.0:
nullthrows "^1.1.1"
yargs "^15.3.1"

babel-plugin-idx@^3.0.3:
version "3.0.3"
resolved "https://registry.yarnpkg.com/babel-plugin-idx/-/babel-plugin-idx-3.0.3.tgz#326d25772210a40ff7fc63eee7f3ed239e8dc9ed"
integrity sha512-05baCoIGsvZJKemq6KQ4KVFlweEpY4aSY56wk3W781JxCNW3u0KfBElBt26/cPZbHkjF1mnwGIOlFY+9I/VOZA==

babel-plugin-istanbul@^6.1.1:
version "6.1.1"
resolved "https://registry.yarnpkg.com/babel-plugin-istanbul/-/babel-plugin-istanbul-6.1.1.tgz#fa88ec59232fd9b4e36dbbc540a8ec9a9b47da73"
Expand Down

0 comments on commit 08b4ee8

Please sign in to comment.