|
Last change
on this file was 9af201e, checked in by MBK <marija.karapandzova@…>, 2 weeks ago |
|
Fix frontend appearance
|
-
Property mode
set to
100644
|
|
File size:
264 bytes
|
| Line | |
|---|
| 1 | 'use strict';
|
|---|
| 2 |
|
|---|
| 3 | const {pathToFileURL} = require('url');
|
|---|
| 4 |
|
|---|
| 5 | module.exports = async filename => {
|
|---|
| 6 | const mod = await import(pathToFileURL(filename));
|
|---|
| 7 | if ('default' in mod === false) {
|
|---|
| 8 | throw new Error(`${filename} has no default export`);
|
|---|
| 9 | }
|
|---|
| 10 |
|
|---|
| 11 | return mod.default;
|
|---|
| 12 | };
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.