mirror of
https://github.com/jspsych/jsPsych.git
synced 2025-05-10 11:10:54 +00:00
put DOM fix modify with citations modify
This commit is contained in:
parent
80c4989431
commit
6707a79eb4
@ -76,12 +76,13 @@ const makeConfig = ({
|
||||
input,
|
||||
plugins: [
|
||||
externals(),
|
||||
modify({
|
||||
modify(
|
||||
{
|
||||
// prettier-ignore
|
||||
find: /'__CITATIONS__'/g,
|
||||
replace: JSON.stringify(citationData, null, 2),
|
||||
}),
|
||||
modify({
|
||||
},
|
||||
{
|
||||
// Patch to mitigate DOM Clobbering vulnerability
|
||||
find: /document\.currentScript/g,
|
||||
replace: `(typeof document !== 'undefined' &&
|
||||
@ -89,7 +90,8 @@ const makeConfig = ({
|
||||
document.currentScript.tagName &&
|
||||
document.currentScript.tagName.toUpperCase() === 'SCRIPT' &&
|
||||
document.currentScript)`,
|
||||
}),
|
||||
}
|
||||
),
|
||||
esbuild({ ...esBuildPluginOptions, target: "node18" }),
|
||||
commonjs(commonjsPluginOptions),
|
||||
],
|
||||
@ -115,12 +117,13 @@ const makeConfig = ({
|
||||
input,
|
||||
plugins: [
|
||||
externals({ deps: false }),
|
||||
modify({
|
||||
modify(
|
||||
{
|
||||
// prettier-ignore
|
||||
find: /'__CITATIONS__'/g,
|
||||
replace: JSON.stringify(citationData, null, 2),
|
||||
}),
|
||||
modify({
|
||||
},
|
||||
{
|
||||
// Patch to mitigate DOM Clobbering vulnerability
|
||||
find: /document\.currentScript/g,
|
||||
replace: `(typeof document !== 'undefined' &&
|
||||
@ -128,7 +131,8 @@ const makeConfig = ({
|
||||
document.currentScript.tagName &&
|
||||
document.currentScript.tagName.toUpperCase() === 'SCRIPT' &&
|
||||
document.currentScript)`,
|
||||
}),
|
||||
}
|
||||
),
|
||||
resolve({ preferBuiltins: false }),
|
||||
esbuild({ ...esBuildPluginOptions, target: "esnext" }),
|
||||
commonjs(commonjsPluginOptions),
|
||||
@ -148,12 +152,13 @@ const makeConfig = ({
|
||||
input,
|
||||
plugins: [
|
||||
externals({ deps: false }),
|
||||
modify({
|
||||
modify(
|
||||
{
|
||||
// prettier-ignore
|
||||
find: /'__CITATIONS__'/g,
|
||||
replace: JSON.stringify(citationData, null, 2),
|
||||
}),
|
||||
modify({
|
||||
},
|
||||
{
|
||||
// Patch to mitigate DOM Clobbering vulnerability
|
||||
find: /document\.currentScript/g,
|
||||
replace: `(typeof document !== 'undefined' &&
|
||||
@ -161,7 +166,8 @@ const makeConfig = ({
|
||||
document.currentScript.tagName &&
|
||||
document.currentScript.tagName.toUpperCase() === 'SCRIPT' &&
|
||||
document.currentScript)`,
|
||||
}),
|
||||
}
|
||||
),
|
||||
resolve({ preferBuiltins: false }),
|
||||
esbuild({ ...esBuildPluginOptions, target: "es2015", minify: true }),
|
||||
commonjs(commonjsPluginOptions),
|
||||
|
Loading…
Reference in New Issue
Block a user