Updates to get the examples building
This commit is contained in:
@@ -58,7 +58,7 @@
|
|||||||
<div class="row-fluid">
|
<div class="row-fluid">
|
||||||
<div id="source-controls">
|
<div id="source-controls">
|
||||||
<a id="copy-button" data-clipboard-target="#example-source"><i class="fa fa-clipboard"></i> Copy</a>
|
<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>
|
</div>
|
||||||
<form method="POST" id="codepen-form" target="_blank" action="https://codepen.io/pen/define/">
|
<form method="POST" id="codepen-form" target="_blank" action="https://codepen.io/pen/define/">
|
||||||
<textarea class="hidden" name="title">{{ title }}</textarea>
|
<textarea class="hidden" name="title">{{ title }}</textarea>
|
||||||
@@ -66,7 +66,6 @@
|
|||||||
<textarea class="hidden" name="js">{{ js.source }}</textarea>
|
<textarea class="hidden" name="js">{{ js.source }}</textarea>
|
||||||
<textarea class="hidden" name="css">{{ css.source }}</textarea>
|
<textarea class="hidden" name="css">{{ css.source }}</textarea>
|
||||||
<textarea class="hidden" name="html">{{ contents }}</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">
|
<input type="hidden" name="data">
|
||||||
</form>
|
</form>
|
||||||
<pre><code id="example-source" class="language-markup"><!DOCTYPE html>
|
<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">
|
<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 -->
|
<!-- 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://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}}
|
{{ indent extraHead.remote spaces=4 }}{{/if}}{{#if css.source}}
|
||||||
<style>
|
<style>
|
||||||
{{ indent css.source spaces=6 }} </style>{{/if}}
|
{{ indent css.source spaces=6 }} </style>{{/if}}
|
||||||
|
|||||||
@@ -38,7 +38,6 @@ const main = {
|
|||||||
{from: 'index.html', to: 'index.html'}
|
{from: 'index.html', to: 'index.html'}
|
||||||
])
|
])
|
||||||
],
|
],
|
||||||
devtool: 'source-map',
|
|
||||||
output: {
|
output: {
|
||||||
filename: '[name].js',
|
filename: '[name].js',
|
||||||
path: path.join(__dirname, '..', '..', 'build', 'examples')
|
path: path.join(__dirname, '..', '..', 'build', 'examples')
|
||||||
@@ -47,6 +46,7 @@ const main = {
|
|||||||
|
|
||||||
// configuration specific to the dev environment
|
// configuration specific to the dev environment
|
||||||
const dev = {
|
const dev = {
|
||||||
|
devtool: 'source-map',
|
||||||
plugins: [
|
plugins: [
|
||||||
new webpack.EnvironmentPlugin(
|
new webpack.EnvironmentPlugin(
|
||||||
Object.assign({NODE_ENV: 'development'}, process.env)
|
Object.assign({NODE_ENV: 'development'}, process.env)
|
||||||
|
|||||||
@@ -150,6 +150,7 @@ ExampleBuilder.prototype.render = async function(dir, chunk) {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
jsSource = jsSource.replace(/'\.\.\/src\//g, '\'');
|
||||||
if (data.cloak) {
|
if (data.cloak) {
|
||||||
for (const entry of data.cloak) {
|
for (const entry of data.cloak) {
|
||||||
jsSource = jsSource.replace(new RegExp(entry.key, 'g'), entry.value);
|
jsSource = jsSource.replace(new RegExp(entry.key, 'g'), entry.value);
|
||||||
|
|||||||
Reference in New Issue
Block a user