I have a .js-file which exports few arrays, like:
export const regularlyChangingArray1 = [ 'item1', 'item2', 'item3' ]
export const regularlyChangingArray2 = [ 'item4', 'item5' ]
I'm accessing those arrays by importing them:
import { regularlyChangingArray1 } from './mypath/myfilename.js'
My problem is that I need to change that single .js-file very often. However, I would not want to go through the full deployment pipeline each time those arrays (and only those) get changed. So, I've tried hosting the .js also separately and get the updated data somehow from there, on-the-fly, replacing the data which goes with the build. I'm not sure if replacing the original .js is even possible on-the-fly, let alone safe - is it?
I don't want to study the use of eval() due to security issues (ref. mozilla.org). What might be the most straight-forward way to get those up-to-date arrays imported? Or should I just restructure my whole code to use something else(?)
I have tried this and that and obviously best (but probably impossible) way might be to somehow import them like:
import { regularlyChangingArray1 } from 'www.address.here/myfilename_clone.js'