Skip to content

Commit 65d67fa

Browse files
authored
build: Change file extension for ES module bundle from .mjs to .es.js (#82)
Summary: Using the .mjs file extension causes issues using React SDK with Gatsby's Node.js build process. Changing the extension to .es.js appears to resolve those issues. Test Plan: Created a test Gatsby application, ran gatsby build. It completed with no errors.
1 parent edea853 commit 65d67fa

File tree

3 files changed

+3
-2
lines changed

3 files changed

+3
-2
lines changed

CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
99

1010
### Bug fixes
1111
- Fix `logOnlyEventDispatcher` to conform to `EventDispatcher` type from @optimizely/optimizely-sdk ([#81](https://github.com/optimizely/react-sdk/pull/81))
12+
- Change the file extension of the ES module bundle from .mjs to .es.js. Resolves issues using React SDK with Gatsby ([#82](https://github.com/optimizely/react-sdk/pull/82)).
1213

1314
## [2.3.2] - October 9th, 2020
1415
Upgrade `@optimizely/optimizely-sdk` to [4.3.4](https://github.com/optimizely/javascript-sdk/releases/tag/v4.3.4):

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"description": "React SDK for Optimizely Full Stack and Optimizely Rollouts",
55
"homepage": "https://github.com/optimizely/react-sdk",
66
"license": "Apache-2.0",
7-
"module": "dist/react-sdk.mjs",
7+
"module": "dist/react-sdk.es.js",
88
"types": "dist/index.d.ts",
99
"main": "dist/react-sdk.js",
1010
"browser": "dist/react-sdk.js",

scripts/build.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ const umdName = 'optimizelyReactSdk'
3232

3333
console.log("\nBuilding ES modules...");
3434

35-
exec(`./node_modules/.bin/rollup -c scripts/config.js -f es -o dist/${packageName}.mjs`);
35+
exec(`./node_modules/.bin/rollup -c scripts/config.js -f es -o dist/${packageName}.es.js`);
3636

3737
console.log("\nBuilding CommonJS modules...");
3838

0 commit comments

Comments
 (0)