Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
silesky committed Aug 25, 2023
1 parent b1049d7 commit 4026589
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 43 deletions.
2 changes: 1 addition & 1 deletion examples/standalone-playground/pages/index-consent.html
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<script src="https://cdn.cookielaw.org/scripttemplates/otSDKStub.js" type="text/javascript"
data-domain-script="80ca7b5c-e72f-4bd0-972a-b74d052a0820-test"></script>
<script
src="/node_modules/@segment/analytics-consent-wrapper-onetrust/dist/bundled/analytics-onetrust.global.development.js">
src="/node_modules/@segment/analytics-consent-wrapper-onetrust/dist/umd/analytics-onetrust.umd.development.js">
</script>

<script>
Expand Down
4 changes: 2 additions & 2 deletions packages/consent/consent-wrapper-onetrust/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,11 +72,11 @@ withOneTrust(analytics).load({ writeKey: '<MY_WRITE_KEY'> })
></script>

<!-- Add OneTrust Consent Wrapper -->
<script src="https://unpkg.com/@segment/analytics-consent-wrapper-onetrust@X.X.X/dist/bundled/analytics-onetrust.global.js"></script>
<script src="https://unpkg.com/@segment/analytics-consent-wrapper-onetrust@X.X.X/dist/umd/analytics-onetrust.umd.js"></script>

<!--
Add / Modify Segment Analytics Snippet
Find and replace: analytics.load() -> withOneTrust(analytics).load()
* Find and replace: analytics.load() -> withOneTrust(analytics).load()
-->
<script>
!function(){var analytics=window.analytics...
Expand Down
5 changes: 1 addition & 4 deletions packages/consent/consent-wrapper-onetrust/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,8 @@
"module": "./dist/esm/index.js",
"types": "./dist/types/index.d.ts",
"sideEffects": [
"./dist/bundled/analytics-onetrust.global.js",
"./dist/bundled/analytics-onetrust.umd.js"
"./dist/umd/analytics-onetrust.umd.js"
],
"jsdeliver": "./dist/global/analytics-onetrust.global.js",
"unpkg": "./dist/global/analytics-onetrust.global.js",
"files": [
"LICENSE",
"dist/",
Expand Down
28 changes: 0 additions & 28 deletions packages/consent/consent-wrapper-onetrust/src/index.global.ts

This file was deleted.

11 changes: 11 additions & 0 deletions packages/consent/consent-wrapper-onetrust/src/index.umd.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
/**
* This file is meant to be used to create a webpack bundle.
*/
import { withOneTrust } from './index'
export { withOneTrust }

// this will almost certainly be executed in the browser, but since this is UMD,
// we are checking just for the sake of being thorough
if (typeof window !== 'undefined') {
;(window as any).withOneTrust = withOneTrust
}
10 changes: 2 additions & 8 deletions packages/consent/consent-wrapper-onetrust/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,8 @@ const isProd = process.env.NODE_ENV === 'production'
*/
module.exports = merge(common, {
entry: {
'analytics-onetrust.global': {
import: path.resolve(__dirname, 'src/index.global.ts'),
library: {
type: 'window',
},
},
'analytics-onetrust.umd': {
import: path.resolve(__dirname, 'src/index.ts'),
import: path.resolve(__dirname, 'src/index.umd.ts'),
library: {
name: 'AnalyticsOneTrust',
type: 'umd',
Expand All @@ -23,7 +17,7 @@ module.exports = merge(common, {
},
output: {
filename: isProd ? '[name].js' : '[name].development.js',
path: path.resolve(__dirname, 'dist/bundled'),
path: path.resolve(__dirname, 'dist/umd'),
chunkFilename: isProd
? '[name].[contenthash].js'
: '[name].[contenthash].development.js',
Expand Down

0 comments on commit 4026589

Please sign in to comment.