Updates to get the examples building

This commit is contained in:
Tim Schaub
2018-05-11 14:02:55 -06:00
parent 519e41db52
commit 1991150079
3 changed files with 4 additions and 4 deletions

View File

@@ -58,7 +58,7 @@
<div class="row-fluid">
<div id="source-controls">
<a id="copy-button" data-clipboard-target="#example-source"><i class="fa fa-clipboard"></i> Copy</a>
<a id="codepen-button"><i class="fa fa-codepen"></i> Edit</a>
<!-- <a id="codepen-button"><i class="fa fa-codepen"></i> Edit</a> -->
</div>
<form method="POST" id="codepen-form" target="_blank" action="https://codepen.io/pen/define/">
<textarea class="hidden" name="title">{{ title }}</textarea>
@@ -66,7 +66,6 @@
<textarea class="hidden" name="js">{{ js.source }}</textarea>
<textarea class="hidden" name="css">{{ css.source }}</textarea>
<textarea class="hidden" name="html">{{ contents }}</textarea>
<input type="hidden" name="resources" value="https://openlayers.org/en/v{{ olVersion }}/css/ol.css,https://openlayers.org/en/v{{ olVersion }}/build/ol.js{{ extraResources }}">
<input type="hidden" name="data">
</form>
<pre><code id="example-source" class="language-markup">&lt;!DOCTYPE html&gt;
@@ -76,7 +75,7 @@
&lt;link rel="stylesheet" href="https://openlayers.org/en/v{{ olVersion }}/css/ol.css" type="text/css"&gt;
&lt;!-- The line below is only needed for old environments like Internet Explorer and Android 4.x --&gt;
&lt;script src="https://cdn.polyfill.io/v2/polyfill.min.js?features=requestAnimationFrame,Element.prototype.classList,URL"&gt;&lt;/script&gt;
&lt;script src="https://openlayers.org/en/v{{ olVersion }}/build/ol.js"&gt;&lt;/script&gt;{{#if extraHead.remote}}
{{#if extraHead.remote}}
{{ indent extraHead.remote spaces=4 }}{{/if}}{{#if css.source}}
&lt;style&gt;
{{ indent css.source spaces=6 }} &lt;/style&gt;{{/if}}

View File

@@ -38,7 +38,6 @@ const main = {
{from: 'index.html', to: 'index.html'}
])
],
devtool: 'source-map',
output: {
filename: '[name].js',
path: path.join(__dirname, '..', '..', 'build', 'examples')
@@ -47,6 +46,7 @@ const main = {
// configuration specific to the dev environment
const dev = {
devtool: 'source-map',
plugins: [
new webpack.EnvironmentPlugin(
Object.assign({NODE_ENV: 'development'}, process.env)

View File

@@ -150,6 +150,7 @@ ExampleBuilder.prototype.render = async function(dir, chunk) {
break;
}
}
jsSource = jsSource.replace(/'\.\.\/src\//g, '\'');
if (data.cloak) {
for (const entry of data.cloak) {
jsSource = jsSource.replace(new RegExp(entry.key, 'g'), entry.value);