-
Notifications
You must be signed in to change notification settings - Fork 131
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implement better exports strategy supporting both commonjs and es6-style
Keep in mind that this commit only applies for the future v4. We noticed that various applications bundling processes expect various ways of packaging a library, some prefer relying on commonjs-style exports for dependencies, other on es6-style exports. To improve on this situation, this commit implements the following way of providing exports: - Both an ES2017 build with ES6 style exports and an ES5 build with commonJS-style exports are generated. The first one is compiled in `./dist/es2017`, the second one in `./dist/commonjs`. - In our package.json, we have a `main` property leading to the commonjs build, a `module` property leading to the es2017 one and an `exports` property listing all possible import paths, leading to one or the other, depending on properties. I sadly had to change a little the way the RxPlayer tools are declared, now always through a directory and inner `index.js` as the `exports` property syntax does not seem to allow for ambiguity on whether a path import `path.js` or `path/index.js`. I also profited from this commit to only build the demo through esbuild, not webpack anymore, as we didn't really rely on the latter anymore.
- Loading branch information
1 parent
5bbf047
commit a40e543
Showing
32 changed files
with
377 additions
and
411 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
18 changes: 18 additions & 0 deletions
18
scripts/build/templates/experimental/tools/createMetaplaylist.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
/** | ||
* Copyright 2015 CANAL+ Group | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
import createMetaplaylist from "../../__BUILD_DIR__/experimental/tools/createMetaplaylist/index.js"; | ||
export * from "../../__BUILD_DIR__/experimental/tools/createMetaplaylist/index.js"; | ||
export default createMetaplaylist; |
18 changes: 18 additions & 0 deletions
18
scripts/build/templates/experimental/tools/mediaCapabilitiesProber.d.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
/** | ||
* Copyright 2015 CANAL+ Group | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
import mediaCapabilitiesProber from "../../__BUILD_DIR__/experimental/tools/mediaCapabilitiesProber/index"; | ||
export * from "../../__BUILD_DIR__/experimental/tools/mediaCapabilitiesProber/index"; | ||
export default mediaCapabilitiesProber; |
18 changes: 18 additions & 0 deletions
18
scripts/build/templates/experimental/tools/mediaCapabilitiesProber.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
/** | ||
* Copyright 2015 CANAL+ Group | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
import mediaCapabilitiesProber from "../../__BUILD_DIR__/experimental/tools/mediaCapabilitiesProber/index.js"; | ||
export * from "../../__BUILD_DIR__/experimental/tools/mediaCapabilitiesProber/index.js"; | ||
export default mediaCapabilitiesProber; |
18 changes: 18 additions & 0 deletions
18
scripts/build/templates/experimental/tools/parseBIFThumbnails.d.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
/** | ||
* Copyright 2015 CANAL+ Group | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
import parseBIFThumbnails from "../../__BUILD_DIR__/experimental/tools/parseBIFThumbnails/index"; | ||
export * from "../../__BUILD_DIR__/experimental/tools/parseBIFThumbnails/index"; | ||
export default parseBIFThumbnails; |
Oops, something went wrong.