-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
[Question] How to override basic HtmlWebpackPlugin options in quasar.config? #4999
Comments
Hi, First step would be to look at current way that the html-webpack-plugin is created: https://github.com/quasarframework/quasar/blob/dev/app/lib/webpack/inject.html.js (think you already did that, but putting here for others too). Then we need a little discussion. The guys over at html-webpack-plugin have released a beta version (4.x) and have updated the docs on their website for this beta version, even though the "latest" (and stable!) release is still 3.x. And there's no place for the 3.x version anymore (you need to go back in their repo's history -- removing the last 45-46 commits). On a sidenote, we will be upgrading to html-webpack-plugin 4.x as soon as it is stable. |
I need to apologize. I missed the most important part: SSR being the mode.
Edit: not what you are looking for. |
I believe that you are interested in vue-server-renderer/client -- https://github.com/vuejs/vue/blob/dev/packages/vue-server-renderer/client-plugin.js |
So how to pass my specific chunk name to exclude it from generated index.html?
Both will be included in the default HtmlWebpackPlugin with its option |
So to eliminate the confusion:
But a question arises: why are you pushing a new entry? Seems to me that you want something (don't know yet what exactly) but you are hacking your way around it in a bad manner... |
There is one 'standalone' thing in oidc-client, which always runned within iframe: example. Direct access to files in node_modules from browser is bad idea, manual copying from node_modules is not our way too. I've push it as another entry without quasar, vue or other things with checking 'chainWebpack -> isClient true'. Just for oidc token background refresh process. Details of implementation here. |
It becomes just the feature request - allow option of 'quasar.config.js' to pass custom 'excludeChunks' to the default HtmlWebpackPlugin of Quasar. |
const merge = require('webpack-merge');
module.exports = function (ctx) {
return {
...
build: {
chainWebpack (chain) {
chain.plugin('html-webpack').tap(args => [ merge(args[0], {
excludeChunks: ['sign-in-silent'],
template: '/path/to/my/template.html',
filename: 'myindex.html',
title: 'My App',
...
})]);
}
... |
But there is nothing to chain as html-webpack in ssr mode. |
I'm sorry but vue-server-renderer does not allow to exclude chunks. There's nothing we can do within Quasar. |
It builds two parts in ssr anyway - for ssr and for spa. Second thing can generate right things. Its just injection into chain to control html-webpack over ssr for client-side step. |
For anyone looking for a solution, you can patch the local file (on your development machine) to accept node_modules@quasar\app\lib\webpack\inject.html.js
quasar.conf.js
This works, because dev-server ( Ideally, we'd get |
I'm trying to exclude specific chunk from index.html, but there is no 'html-webpack' plugin name in chain when
quasar dev -m ssr
is runned. But it exists when looking atquasar inspect
.The text was updated successfully, but these errors were encountered: