Hi guys,
I'm using html-webpack-plugin for injecting built sources into index.html file.
But, since I'm building an application under Cordova, it need to be added without trailing slash at beginning.
How can it be achieved?
Here is my configuration for plugin:
new HtmlWebpackPlugin({
template: './src/public/index.html',
chunksSortMode: 'dependency'
}),
It results into this HTML:
<script type="text/javascript" src="/js/polyfills.e2cf4996bb91076c61e3.js"></script>
<script type="text/javascript" src="/js/vendor.e2cf4996bb91076c61e3.js"></script>
<script type="text/javascript" src="/js/app.e2cf4996bb91076c61e3.js"></script>
But I need to get without trailing slash.
Thanks for your response.
cc @jantimon
I've found a solution. You need to change publicPath in Webpack config to '' and change <base href="/"> in index.html to <base href="./">.
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
Most helpful comment
I've found a solution. You need to change
publicPathin Webpack config to''and change<base href="/">inindex.htmlto<base href="./">.