Html-webpack-plugin: Cannot inject js for webpack-sev-server?

Created on 25 Jan 2017  路  5Comments  路  Source: jantimon/html-webpack-plugin

    "html-webpack-plugin": "^2.26.0",
    "webpack": "^2.2.0",
    "webpack-dev-server": "^2.2.0"
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <title><%= htmlWebpackPlugin.options.title %></title>
</head>
<body>
</body>
</html>

plugins: [
        new HtmlWebpackPlugin({
            title: 'Funds view',
            filename: 'index.html',
            template: './index.html',
            inject: true,
            hash: true
        })
    ]
"scripts": {
    "dev": "cross-env NODE_ENV=development webpack-dev-server --open --inline --hot",
    "build": "cross-env NODE_ENV=production webpack --progress --hide-modules"
  }

build was right

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <title>Funds view</title>
</head>
<body>
<script type="text/javascript" src="/dist/main.js?411eceaea4b7175d3cb4"></script></body>
</html>

dev not inject
image

Most helpful comment

All 5 comments

I can confirm this as well. This drove me nuts until I finally found this: http://stackoverflow.com/questions/39585680/html-webpack-plugin-not-inject-js-file-into-index-html-when-using-webpack-dev-se

Any way around this?

The same problem, and write to disk doesn't help

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.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

MatthewKosloski picture MatthewKosloski  路  3Comments

meleyal picture meleyal  路  3Comments

lcxfs1991 picture lcxfs1991  路  4Comments

azat-io picture azat-io  路  4Comments

klinki picture klinki  路  3Comments