question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Trying to add a custom index.html

See original GitHub issue

Do you want to request a feature or report a bug? Yes

What is the current behaviour? When I added the index.html and trying to build with it using preact buld --template {path} I get TypeError: Cannot read property 'compilation' of undefined

If the current behaviour is a bug, please provide the steps to reproduce.

  1. cp node_modules/preact-cli/lib/resources/template.html src/index.html
  2. preact build --template ./src/index.html

What is the expected behaviour? Project builds successfully

If this is a feature request, what is motivation or use case for changing the behaviour?

Please mention other relevant information. preact.config.js:

import envVars from 'preact-cli-plugin-env-vars';

export default function (config, env, helpers) {
  envVars(config, env, helpers);
}

Please paste the results of preact info here. preact-cli 2.2.1

It’s a pretty basic app created with preact CLI.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:17 (9 by maintainers)

github_iconTop GitHub Comments

3reactions
prateekbhcommented, Feb 6, 2020

template.html

<!DOCTYPE html>
<html lang="en">
	<head>
		<meta charset="utf-8">
		<title>Preact CLI Demo</title>
		<meta name="viewport" content="width=device-width,initial-scale=1">
		<meta name="mobile-web-app-capable" content="yes">
		<meta name="apple-mobile-web-app-capable" content="yes">
		<meta name="demo-keyword" content="<%= htmlWebpackPlugin.options.blah %>">
		<% preact.headEnd %>
	</head>
	<body>
		<% preact.bodyEnd %>
	</body>
</html>

prerender-urls.json

[
  {
    "url": "/",
    "blah": "some value"
  }
]
0reactions
prateekbhcommented, Feb 6, 2020

i’ll update our docs as well 😃

Read more comments on GitHub >

github_iconTop Results From Across the Web

Creating a custom index.html file - Name.com
Click New File in the upper left corner and name the file index.html. Highlight the file by clicking once and then click the...
Read more >
Creating An Html File - Mike Dane
This tutorial covers how to use creating an html file in HTML. ... Now that you have index.html open on your browser, whenever...
Read more >
Creating an Index for a Web Site | Microsoft Learn
Create the HTML file that will contain your index. Place your cursor at the location where you want the index file to appear,...
Read more >
providing custom index.html file for electron-webpack
html for you using html-webpack-plugin , I want to provide my own index.html instead of the default one. – Houss_gc. Sep 16, 2017...
Read more >
How can i set my custom index.html page ? | Vaadin
In fact I would like to call my own javascript library in all my vaadin applications. I saw that it was possible to...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found