-
Notifications
You must be signed in to change notification settings - Fork 47
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: Remove webpack imports in npm package
- Loading branch information
1 parent
9482e8f
commit e96f091
Showing
12 changed files
with
41 additions
and
171 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,26 @@ | ||
/** | ||
* @file This file exposes build time environment variables that will be included in the | ||
* build output of the agent. This file specifically contains the normal environment variables | ||
* for the NPM agent build and will be overridden by webpack/babel during the build based on the | ||
* type of build being performed. | ||
* @file This file exposes NPM build environment variables. These variables will | ||
* be overridden with babel. | ||
*/ | ||
|
||
import pkgJSON from '../../../package.json' | ||
|
||
/** | ||
* Exposes the version of the agent | ||
*/ | ||
export const VERSION = pkgJSON.version | ||
export const VERSION = process.env.BUILD_VERSION | ||
|
||
/** | ||
* Exposes the build type of the agent | ||
* Valid values are LOCAL, PROD, DEV | ||
*/ | ||
export const BUILD_ENV = 'NPM' | ||
|
||
/** | ||
* Exposes the distribution method of the agent | ||
* Valid valuse are CDN, NPM | ||
*/ | ||
export const DIST_METHOD = 'NPM' | ||
|
||
/** | ||
* Exposes the lib version of rrweb | ||
*/ | ||
export const RRWEB_VERSION = pkgJSON.dependencies.rrweb | ||
export const RRWEB_VERSION = process.env.RRWEB_VERSION |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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,12 @@ | ||
/* global __webpack_require__ */ | ||
|
||
__webpack_require__.nc = (() => { | ||
try { | ||
return document?.currentScript?.nonce | ||
} catch (ex) { | ||
// Swallow error and proceed like nonce is not defined | ||
// This will happen when the agent is loaded in a worker scope | ||
} | ||
|
||
return '' | ||
})() |
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 |
---|---|---|
@@ -1,12 +1 @@ | ||
/* global __webpack_require__ */ | ||
|
||
__webpack_require__.nc = (() => { | ||
try { | ||
return document?.currentScript?.nonce | ||
} catch (ex) { | ||
// Swallow error and proceed like nonce is not defined | ||
// This will happen when the agent is loaded in a worker scope | ||
} | ||
|
||
return '' | ||
})() | ||
// We don't support setting automating the nonce attribute in the npm package |
This file was deleted.
Oops, something went wrong.
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,9 @@ | ||
// Set the default CDN or remote for fetching the assets; NPM shouldn't change this var. | ||
|
||
export const redefinePublicPath = (urlString) => { | ||
const isOrigin = urlString.startsWith('http') | ||
// Input is not expected to end in a slash, but webpack concats as-is, so one is inserted. | ||
urlString += '/' | ||
// If there's no existing HTTP scheme, the secure protocol is prepended by default. | ||
__webpack_public_path__ = isOrigin ? urlString : 'https://' + urlString // eslint-disable-line | ||
} |
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 |
---|---|---|
@@ -1,9 +1,3 @@ | ||
// Set the default CDN or remote for fetching the assets; NPM shouldn't change this var. | ||
|
||
export const redefinePublicPath = (urlString) => { | ||
const isOrigin = urlString.startsWith('http') | ||
// Input is not expected to end in a slash, but webpack concats as-is, so one is inserted. | ||
urlString += '/' | ||
// If there's no existing HTTP scheme, the secure protocol is prepended by default. | ||
__webpack_public_path__ = isOrigin ? urlString : 'https://' + urlString // eslint-disable-line | ||
export const redefinePublicPath = () => { | ||
// We don't support setting public path in webpack via NPM build. | ||
} |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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