html-webpack-plugin

Is it possible to have html-webpack-plugin generate <style> elements from css?

▼魔方 西西 提交于 2021-01-21 07:32:11
问题 I have a static site where I am using Vue and Webpack. I have some global CSS rules in a file called style.css and I am importing them by using import './styles.css' from my index.js file. Additionally, I have some .vue files which generate their own CSS. To generate the HTML page, I am using html-webpack-plugin . My CSS rules appear to be applying correctly. However, the <style> tags which contain them are dynamically being added to the <head> of my page via the Javascript that Webpack

Webpack html-webpack-plugin load favicons in template

杀马特。学长 韩版系。学妹 提交于 2020-08-21 05:28:32
问题 I'm using Webpack with html-webpack-plugin and their provided template. I want to add a list of favicons in the header: <link rel="apple-touch-icon" sizes="57x57" href="<%= htmlWebpackPlugin.extraFiles.apple-touch-icon-57x57 %>"> <link rel="apple-touch-icon" sizes="60x60" href="<%= htmlWebpackPlugin.extraFiles.favicons.fav60%>"> <link rel="apple-touch-icon" sizes="72x72" href="<%= htmlWebpackPlugin.extraFiles.favicons.fav72%>"> <link rel="apple-touch-icon" sizes="76x76" href="favicons/apple

Webpack html-webpack-plugin load favicons in template

两盒软妹~` 提交于 2020-08-21 05:28:13
问题 I'm using Webpack with html-webpack-plugin and their provided template. I want to add a list of favicons in the header: <link rel="apple-touch-icon" sizes="57x57" href="<%= htmlWebpackPlugin.extraFiles.apple-touch-icon-57x57 %>"> <link rel="apple-touch-icon" sizes="60x60" href="<%= htmlWebpackPlugin.extraFiles.favicons.fav60%>"> <link rel="apple-touch-icon" sizes="72x72" href="<%= htmlWebpackPlugin.extraFiles.favicons.fav72%>"> <link rel="apple-touch-icon" sizes="76x76" href="favicons/apple

How to move css links to the bottom of the html document with webpack?

六眼飞鱼酱① 提交于 2020-05-17 07:59:29
问题 The way my webpack is currently being set up, it places the css resources links in the head of the document, which blocks the rendering of my initial content. Example: <head> <link href="main.28396255e7678a2cdf3c.css" rel="stylesheet"> </head> Therefore, I'd like to move them at the bottom of the document, right before </body> . Is there a way to configure what I already have, to achieve this, or is there maybe a plugin I wasn't able to find? Here's some of my webpack config: {{ entry: { app:

HTML Webpack Plugin will not compile as Thymeleaf variables are undefined

巧了我就是萌 提交于 2020-03-23 07:20:15
问题 When Webpack compiles my app which contains the below HTML, it complains the theme variable is undefined. Here is my index.html file: <!DOCTYPE html> <html lang="en" xmlns:th="http://www.thymeleaf.org"> <head> <meta charset="UTF-8"/> </head> <body th:class="${theme}"> <div id="root"></div> </body> </html> And here is the error I get: Failed to compile. Error in Template execution failed: ReferenceError: theme is not defined - loader.js:4 eval /src/main/resources/templates/index.html?./~/html

HTML Webpack Plugin will not compile as Thymeleaf variables are undefined

荒凉一梦 提交于 2020-03-23 07:20:11
问题 When Webpack compiles my app which contains the below HTML, it complains the theme variable is undefined. Here is my index.html file: <!DOCTYPE html> <html lang="en" xmlns:th="http://www.thymeleaf.org"> <head> <meta charset="UTF-8"/> </head> <body th:class="${theme}"> <div id="root"></div> </body> </html> And here is the error I get: Failed to compile. Error in Template execution failed: ReferenceError: theme is not defined - loader.js:4 eval /src/main/resources/templates/index.html?./~/html

html-webpack-plugin and webpack 2: no starting slash '/'

我与影子孤独终老i 提交于 2020-01-13 19:08:13
问题 I have a working webpack 1 project that I want to migrate to webpack 2 . It is almost working, my main remaining problem is with html-webpack-plugin : when I use it in webpack 2, the generated script tag is of the form: <script type="text/javascript" src="static/js/bundle.js"></script> instead of: <script type="text/javascript" src="/static/js/bundle.js"></script> Note: with the same plugin options, it works as expected in Webpack 1. Here are the relevant parts of webpack conf: entry: [ paths

html-webpack-plugin and webpack 2: no starting slash '/'

白昼怎懂夜的黑 提交于 2020-01-13 19:07:37
问题 I have a working webpack 1 project that I want to migrate to webpack 2 . It is almost working, my main remaining problem is with html-webpack-plugin : when I use it in webpack 2, the generated script tag is of the form: <script type="text/javascript" src="static/js/bundle.js"></script> instead of: <script type="text/javascript" src="/static/js/bundle.js"></script> Note: with the same plugin options, it works as expected in Webpack 1. Here are the relevant parts of webpack conf: entry: [ paths