Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Inject not work #14

Open
velocat opened this issue Nov 27, 2020 · 0 comments
Open

Inject not work #14

velocat opened this issue Nov 27, 2020 · 0 comments

Comments

@velocat
Copy link

velocat commented Nov 27, 2020

Regardless of what is specified in Inject, for external, css files are always located in the head, and js files are always located at the end of the body.

  1. This does not allow executing online scripts, for example, those that depend on pluggable external libraries in the html body
html2({
	template: 'src/index.html',
	fileName: 'index.html',
	inject: 'head',
	externals: [
		{type: 'css', file: 'https://unpkg.com/[email protected]/dist/leaflet.css', pos: 'before' },
		{type: 'js', file: 'https://unpkg.com/[email protected]/dist/leaflet.js', pos: 'before' },
		{type: 'js', file: 'https://code.jquery.com/jquery-3.5.1.min.js', pos: 'before' },
		{type: 'css', file: 'https://code.jquery.com/ui/1.12.1/themes/hot-sneaks/jquery-ui.css', pos: 'before' },
		{type: 'js', file: 'https://code.jquery.com/ui/1.12.1/jquery-ui.min.js', pos: 'before' }
	],
	minify: {
		removeComments: true
	},
})
  1. DOCTYPE is also added, even if it is in template
  2. Bundled css is not added at all, only if you specify it in the template

HTML

How to fix it?

PS I haven't found a normal alternative, so I'll have to use this one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant