Inline scripts in HTML files
This commit is contained in:
10
modules/actions/utils/getGlobalScripts.js
Normal file
10
modules/actions/utils/getGlobalScripts.js
Normal file
@ -0,0 +1,10 @@
|
||||
import invariant from 'invariant';
|
||||
|
||||
import createElement from './createElement';
|
||||
|
||||
export default function getGlobalScripts(entryPoint, globalURLs) {
|
||||
return entryPoint.globalImports.map(id => {
|
||||
invariant(globalURLs[id], 'Missing global URL for id "%s"', id);
|
||||
return createElement('script', { src: globalURLs[id] });
|
||||
});
|
||||
}
|
Reference in New Issue
Block a user