Code Monkey home page Code Monkey logo

html-insert-assets's People

Contributors

aghassi avatar alan-agius4 avatar dependabot[bot] avatar jbedard avatar ztl8702 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

html-insert-assets's Issues

Support for Manifests

I would like to use this package for a PWA.
Thus a --manifest argument would be really handy.

Example

--manifest manifest.webmanifest

should result in

<link rel="manifest" href="manifest.webmanifest" />

`async` is resolved as `async=""`

In the head of my html I have a link to a font like this

<link href="https://fonts.googleapis.com/css2?family=Roboto&display=swap" rel="stylesheet" async />

But after running html-insert-assets I get this as an output:

<link href="https://fonts.googleapis.com/css2?family=Roboto&amp;display=swap" rel="stylesheet" async="">

Not the difference of async. It is now async="". But it should just be async

html5 doctype tag causes crash

Since the parse5 upgrade?

TypeError: treeAdapter.getChildNodes is not a function or its return value is not iterable
    at findElementByName (.../node_modules/html-insert-assets/dist/main.js:35:33)
    at findElementByName (.../node_modules/html-insert-assets/dist/main.js:36:24)
    at Object.main (.../node_modules/html-insert-assets/dist/main.js:297:18)
    at Object.<anonymous> (.../node_modules/html-insert-assets/dist/run.js:4:27)

make the leading slash configurable

when a base href is used than the injected js + asset file paths wont work. It always tries to
go to the main domain instead off the subfolder where the app is running

example:
domain.com/shop/app -> the injected paths with leading slash will show to domain.com/xxx.js instead of domain.com/shop/app/xxx.js.

Fails under docker. Most likely to fail under different distros.

I have been trying to understand why this package was not working. I have been getting an error when I put a statement into my docker file like this;

RUN html-insert-assets --out index.html --assets switch.css switch.js --verbose

It was giving an error;

/usr/local/bin/html-insert-assets: 1: /usr/local/bin/html-insert-assets: //: Permission denied /usr/local/bin/html-insert-assets: 3: /usr/local/bin/html-insert-assets: Syntax error: "(" unexpected

Turns out that the bin was pointed out to be src/main.js which does not include a shebang statement to tell how to interpret this binary which is the main reason for the error.

Add support for Preloading requests

Feature request

Page load times can be decreased by preloading links: https://web.dev/uses-rel-preload/

Which can be added to the head of a document:

<head>
  ...
  <link rel="preload" href="styles.css" as="style">
  <link rel="preload" href="ui.js" as="script">
  ...
</head>

Would be cool to see something like this:

html-insert-assets
    --preload my.js my.css

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.