Updates to get the examples building
This commit is contained in:
@@ -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"><!DOCTYPE html>
|
||||
@@ -76,7 +75,7 @@
|
||||
<link rel="stylesheet" href="https://openlayers.org/en/v{{ olVersion }}/css/ol.css" type="text/css">
|
||||
<!-- The line below is only needed for old environments like Internet Explorer and Android 4.x -->
|
||||
<script src="https://cdn.polyfill.io/v2/polyfill.min.js?features=requestAnimationFrame,Element.prototype.classList,URL"></script>
|
||||
<script src="https://openlayers.org/en/v{{ olVersion }}/build/ol.js"></script>{{#if extraHead.remote}}
|
||||
{{#if extraHead.remote}}
|
||||
{{ indent extraHead.remote spaces=4 }}{{/if}}{{#if css.source}}
|
||||
<style>
|
||||
{{ indent css.source spaces=6 }} </style>{{/if}}
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user