Move bundle for ivm to server
This commit is contained in:
parent
62994c2026
commit
f28417a776
3 changed files with 13 additions and 2 deletions
|
@ -7,11 +7,11 @@ module.exports = {
|
||||||
|
|
||||||
if (
|
if (
|
||||||
/^@budibase\/[^/]+\/.*$/.test(importPath) &&
|
/^@budibase\/[^/]+\/.*$/.test(importPath) &&
|
||||||
importPath !== "@budibase/backend-core/tests"
|
!["@budibase/backend-core/tests","@budibase/string-templates/js-helpers"].includes(importPath)
|
||||||
) {
|
) {
|
||||||
context.report({
|
context.report({
|
||||||
node,
|
node,
|
||||||
message: `Importing from @budibase is not allowed, except for @budibase/backend-core/tests.`,
|
message: `Importing from @budibase is not allowed, except for @budibase/backend-core/tests and @budibase/string-templates/js-helpers.`,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
10
packages/server/src/jsRunner/bundles/index-helpers.ts
Normal file
10
packages/server/src/jsRunner/bundles/index-helpers.ts
Normal file
|
@ -0,0 +1,10 @@
|
||||||
|
import getJsHelperList from '@budibase/string-templates/js-helpers'
|
||||||
|
|
||||||
|
const helpers = getJsHelperList()
|
||||||
|
module.exports = {
|
||||||
|
...helpers,
|
||||||
|
// pointing stripProtocol to a unexisting function to be able to declare it on isolated-vm
|
||||||
|
// @ts-ignore
|
||||||
|
// eslint-disable-next-line no-undef
|
||||||
|
stripProtocol: helpersStripProtocol,
|
||||||
|
}
|
|
@ -12,6 +12,7 @@
|
||||||
"import": "./dist/bundle.mjs"
|
"import": "./dist/bundle.mjs"
|
||||||
},
|
},
|
||||||
"./package.json": "./package.json",
|
"./package.json": "./package.json",
|
||||||
|
"./js-helpers": "./src/index-helpers.js",
|
||||||
"./index-helpers": "./dist/index-helpers.bundled.js",
|
"./index-helpers": "./dist/index-helpers.bundled.js",
|
||||||
"./test/utils": "./test/utils.js"
|
"./test/utils": "./test/utils.js"
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in a new issue