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
Trying to use webpacker (3) for a API/JS client #1016
Comments
This might be useful for your case: https://github.com/jantimon/html-webpack-plugin |
Pretty old example on v2, but here's how can do it: https://github.com/gauravtiwari/webpacker-rails-api/blob/master/config/webpack/shared.js#L75 https://github.com/gauravtiwari/webpacker-rails-api/blob/master/config/webpack/shared.js#L65 If you are using v3, just follow the new API's for adding plugins. The plugin @guilleiguaran pointed out will insert the relevant files for you. |
Thanks a lot @guilleiguaran @gauravtiwari |
@guilleiguaran I tried to use the plugin, but it seems I'm doing something wrong ; could you help me ? I have read the webpacker doc in order to add a plugin so I added this in my
The webpack trace does not say anything about HtmlWebpackPlugin :
|
That should be set: const htmlWebpackPlugin = new HtmlWebpackPlugin({
inject: 'body',
alwaysWriteToDisk: true
});
environment.plugins.set('HtmlWebpackPlugin', htmlWebpackPlugin) |
Thanks a lot. I thought it should be |
I'm trying to create a rails api and a separated JS client using webpacker.
When launching my app, the
public/packs/manifest.json
contains this :And I whant to use it in my
public/index.html
file as it :Is there a way to configure webpacker not to generate file with the random number ? Or a better way to make the
index.html
launch the good generated files ? Thanks.The text was updated successfully, but these errors were encountered: