Remove '.js' from the imports
This commit is contained in:
1 parent
4a3f70c09b
commit
63de0aefbe
1 file changed
+2
@@ -155,7 +155,9 @@ ExampleBuilder.prototype.render = async function(dir, chunk) {
|
||||
if (!jsSource) {
|
||||
throw new Error(`No .js source for ${jsName}`);
|
||||
}
|
||||
// remove "../src/" prefix and ".js" to have the same import syntax as the documentation
|
||||
jsSource = jsSource.replace(/'\.\.\/src\//g, '\'');
|
||||
jsSource = jsSource.replace(/\.js';/g, '\';');
|
||||
if (data.cloak) {
|
||||
for (const entry of data.cloak) {
|
||||
jsSource = jsSource.replace(new RegExp(entry.key, 'g'), entry.value);
|
||||
|
||||
Reference in new issue
Block a user