Open paulbuechner opened 8 months ago
I compiled it without issues using the following cfg modification (using pnpm
):
// formatjs is checking 'this' and it throws this warning
if (warning.code === 'THIS_IS_UNDEFINED' &&
(
warning.id.includes('@formatjs/intl-utils/lib/src/resolve-locale.js') ||
warning.id.includes('@formatjs/intl-utils/lib/src/diff.js')
)
) {
//console.log(warning);
return;
}
But still getting the 404 Not Found
on http://127.0.0.1:5500
It seems like you can only operate this script from within hs... Correct me if I'm wrong...
So the standard procedure is to copy and replace the compiled script to hs?
Hi, it should be as easy as:
git clone ...
npm install
npm start
Then the project is built and served on http://127.0.0.1:5500/hue-like-light-card.js
This URL you can add to your HA instance as a resource (URL: {HA}/config/lovelace/resources
)
Ctrl+F5 and you are ready to go. (then you need to Ctrl+F5 every time the script is altered)
The card during development process has different name (type: custom:hue-like-light-card-test
- mind the '-test' postfix), so you don't have to remove the classic installed version.
As an alternative you can use some other web serving tool (like this extension to VS Code) and use command npm run fixnbuild
for creating new versions of script manually in the /dist
folder of the project.
I believe the adress of the script is then something like http://127.0.0.1:5500/dist/hue-like-light-card.js
The fix in the name means automatic fix of linting issues
This is the old method, I've used before rollup-serve plugin.
Can we please add a CONTRIBUTING.md or SETUP.md guide which explains how to get the project up and running...
For me, I have trouble getting the
start
cmd to work:First of all, I had to add the missing dependency
lit-html
, but now getting the following error: