Show notice when using experimental features

This commit is contained in:
Tim Schaub
2019-09-26 20:06:28 +02:00
parent 6a5f6e4363
commit 443213e175
3 changed files with 22 additions and 0 deletions

View File

@@ -200,6 +200,12 @@ ExampleBuilder.prototype.render = async function(dir, chunk) {
tag: `<script src="${this.common}.js"></script><script src="${jsName}"></script>`,
source: jsSource
};
if (data.experimental) {
const prelude = '<script>window.experimental = true;</script>';
data.js.tag = prelude + data.js.tag;
}
data.pkgJson = JSON.stringify({
name: name,
dependencies: getDependencies(jsSource),