Skip to content

Commit

Permalink
A new way to fix device-uuid
Browse files Browse the repository at this point in the history
  • Loading branch information
apporc committed Aug 28, 2023
1 parent f5ffcc9 commit bf7bc45
Showing 1 changed file with 47 additions and 41 deletions.
88 changes: 47 additions & 41 deletions rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,47 +23,53 @@ const external = [...Object.keys(pkg.peerDependencies), 'isomorphic-ws']

/** @type {import('rollup').RollupOptions} */
export default [
{
input: 'src/index.ts',
output: {
banner,
file: pkg.main,
format: 'cjs',
sourcemap: true,
exports: 'named',
},
plugins: [
typescript({target: 'es6'}),
commonjs({
defaultIsModuleExports: false,
}),
nodePolyfills(),
],
external,
{
input: 'src/index.ts',
output: {
banner,
file: pkg.main,
format: 'cjs',
sourcemap: true,
exports: 'named',
},
{
input: 'src/index.ts',
output: {
banner,
file: pkg.module,
format: 'esm',
sourcemap: true,
},
plugins: [
typescript({target: 'es2020'}),
commonjs({
defaultIsModuleExports: false,
}),
nodePolyfills(),
replace({
'_require.DeviceUUID': 'window.DeviceUUID',
}),
],
external,
},
{
input: 'src/index.ts',
output: {banner, file: pkg.types, format: 'esm'},
plugins: [dts()],
plugins: [
typescript({ target: 'es6' }),
commonjs({
defaultIsModuleExports: false,
}),
nodePolyfills(),
replace({
"})(commonjsGlobal);": "})(deviceUuid);",
delimiters: ['', '']
}),

],
external,
},
{
input: 'src/index.ts',
output: {
banner,
file: pkg.module,
format: 'esm',
sourcemap: true,
},
plugins: [
typescript({ target: 'es2020' }),
commonjs({
defaultIsModuleExports: false,
}),
nodePolyfills(),
replace({
"})(commonjsGlobal)": "})(deviceUuid)",
delimiters: ['', '']
}),
],
external,
},
{
input: 'src/index.ts',
output: { banner, file: pkg.types, format: 'esm' },
plugins: [dts()],
},
]

0 comments on commit bf7bc45

Please sign in to comment.