Skip to content

Commit

Permalink
Add requirejs support (#1133)
Browse files Browse the repository at this point in the history
  • Loading branch information
silesky committed Sep 3, 2024
1 parent 17432de commit 3abc609
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 4 deletions.
5 changes: 5 additions & 0 deletions .changeset/rotten-papayas-flash.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@segment/analytics-consent-wrapper-onetrust': minor
---

Add RequireJS support (analytics-onetrust.js)
2 changes: 1 addition & 1 deletion packages/consent/consent-wrapper-onetrust/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ If you don't see a "Consent Management" option like the one below, please contac
</script>

<!-- Add Segment's OneTrust Consent Wrapper -->
<script src="https://cdn.jsdelivr.net/npm/@segment/analytics-consent-wrapper-onetrust@latest/dist/umd/analytics-onetrust.umd.js"></script>
<script src="https://cdn.jsdelivr.net/npm/@segment/analytics-consent-wrapper-onetrust@latest/dist/umd/analytics-onetrust.js"></script>

<!--
Add / Modify Segment Analytics Snippet
Expand Down
7 changes: 4 additions & 3 deletions packages/consent/consent-wrapper-onetrust/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,11 @@
"module": "./dist/esm/index.js",
"types": "./dist/types/index.d.ts",
"sideEffects": [
"./dist/umd/analytics-onetrust.umd.js"
"./dist/umd/analytics-onetrust.umd.js",
"./dist/umd/analytics-onetrust.js"
],
"jsdelivr": "./dist/umd/analytics-onetrust.umd.js",
"unpkg": "./dist/umd/analytics-onetrust.umd.js",
"jsdelivr": "./dist/umd/analytics-onetrust.js",
"unpkg": "./dist/umd/analytics-onetrust.js",
"files": [
"LICENSE",
"dist/",
Expand Down
7 changes: 7 additions & 0 deletions packages/consent/consent-wrapper-onetrust/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,13 @@ module.exports = merge(common, {
type: 'umd',
},
},
'analytics-onetrust': {
import: path.resolve(__dirname, 'src/index.ts'),
library: {
name: 'AnalyticsOneTrust',
type: 'window',
},
},
},
output: {
filename: isProd ? '[name].js' : '[name].development.js',
Expand Down

0 comments on commit 3abc609

Please sign in to comment.