Browse Source

Merge pull request #2855 from overleaf/msm-update-modules-imports-esm

Update modules-ide and modules-main to generate ESM modules

GitOrigin-RevId: 2463591afd50a71cf6a4f728b54db3289f9c13ed
nate stemen 6 years ago
parent
commit
49066b6ffe
2 changed files with 2 additions and 2 deletions
  1. 1 1
      services/web/modules/modules-ide.js
  2. 1 1
      services/web/modules/modules-main.js

+ 1 - 1
services/web/modules/modules-ide.js

@@ -20,6 +20,6 @@ if (fs.existsSync(MODULES_PATH)) {
 
 module.exports = function() {
   return {
-    code: `define(['${entryPoints.join("', '")}'], function() {})`
+    code: entryPoints.map(entryPoint => `import '${entryPoint}'`).join('\n')
   }
 }

+ 1 - 1
services/web/modules/modules-main.js

@@ -20,6 +20,6 @@ if (fs.existsSync(MODULES_PATH)) {
 
 module.exports = function() {
   return {
-    code: `define(['${entryPoints.join("', '")}'], function() {})`
+    code: entryPoints.map(entryPoint => `import '${entryPoint}'`).join('\n')
   }
 }