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

Not generating ouput with multiple entries #6040

Closed
superandrew opened this issue Nov 29, 2017 · 5 comments
Closed

Not generating ouput with multiple entries #6040

superandrew opened this issue Nov 29, 2017 · 5 comments

Comments

@superandrew
Copy link

Do you want to request a feature or report a bug?

What is the current behavior?
I need to define two pages with two different entry points, as suggested here https://medium.com/a-beginners-guide-for-webpack-2/multi-page-applications-4ae2ebfabc37

If the current behavior is a bug, please provide the steps to reproduce.
I am using jhipster's webpack, so this is my configuration

this is the configuration that fails
common:
https://gist.github.com/superandrew/9222e7cb3fc7abe15c5935cad29f8a74
dev:
https://gist.github.com/superandrew/5f65ab0d1a5b4c406d8fb1f3a7accbd0

What is the expected behavior?
I want the plugin to generate in /build/www two files, index.html and lab.html. index.html should contain chunks polyfills, vendor and main, lab polyfills, vendor and lab

The output is

Child html-webpack-plugin for "build/www/index.html":
     1 asset
    [./node_modules/html-webpack-plugin/lib/loader.js!./src/main/webapp/index.html] ./node_modules/html-webpack-plugin/lib/loader.js!./src/main/webapp/index.html 880 bytes {0} [built]
            factory:361ms building:865ms = 1226ms
Child html-webpack-plugin for "build/www/lab.html":
     2 assets
    [./node_modules/html-webpack-plugin/lib/loader.js!./src/main/webapp/lab.html] ./node_modules/html-webpack-plugin/lib/loader.js!./src/main/webapp/lab.html 676 bytes {0} [built]
            factory:148ms building:1113ms = 1261ms
    [./src/main/webapp/lab/assets/images/ng-book-2-minibook.png] ./src/main/webapp/lab/assets/images/ng-book-2-minibook.png 90 bytes {0} [built]
           [] -> factory:3397ms building:622ms = 4019ms
webpack: Compiled with warnings.

but no html file is generated.

The only way to have the plugin generate a file is this:

 new HtmlWebpackPlugin({
                template: './src/main/webapp/index.html',
                chunksSortMode: 'dependency',
                inject: 'body'
            }),

However this generates only the last one if I put two plugins, so I get with and index.html with the content of lab.html or index.html depending on who's last in the plugin array.

If this is a feature request, what is motivation or use case for changing the behavior?

Please mention other relevant information such as the browser version, Node.js version, webpack version and Operating System.
I'm on Mac Os 13, the browser isn't involved, and node is v8.

@sokra
Copy link
Member

sokra commented Nov 30, 2017

Thanks for your report. It would be great if you reduce your issue to a small reproducible example. Best put this example into a github repository together with instructions how to get to the problem.

@soulteary
Copy link

there's trick patches, maybe helpful for you.

https://github.com/soulteary/webpack-custom-plugin


btw, if you wanna use full dynamics path in your project, you may hack the html-template, css backaground url by yourself.

@alexander-akait
Copy link
Member

@superandrew problem still exists?

@webpack-bot
Copy link
Contributor

This issue had no activity for at least half a year.

It's subject to automatic issue closing if there is no activity in the next 15 days.

@webpack-bot
Copy link
Contributor

Issue was closed because of inactivity.

If you think this is still a valid issue, please file a new issue with additional information.

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

No branches or pull requests

5 participants