Why html file doesn't see function in bundle.js?
<p>Begin work with webpack and stack. My generated html file consist string with event onclick. But my html file doest't see function in generated file bundle.js. Bundle js file conected successfully(console.log works). But if i write <code>&lt;script&gt;function bar()...&lt;/script&gt;</code> in html, onclick work. Help.
Try connect file in head, beggining body, end of body/file - doesn't see function. Bundle.js generated from  main.js:</p>

<pre><code>require("path to css...");
function bar(){...};
</code></pre>

<p>String in html:</p>

<pre><code>&lt;div class="foo" onclick="bar()"&gt;...&lt;/div&gt;
</code></pre>

<p>Bundle.js:</p>

<pre><code>var HtmlWebpackPlugin = require('html-webpack-plugin');
var ExtractTextPlugin = require("extract-text-webpack-plugin");

module.exports = {
    entry: "./src/main.js",
    output: {
    path: "dist",
    filename: "bundle.js"
},

module: {
    loaders: [
    {
        test: /\.js$/,
        loader: "babel-loader",
        options: { presets: ["es2015"] }
     ,
    {
        test: /\.css$/,
        loader: ExtractTextPlugin.extract('style','css')
    },
    {
        test: /\.jade$/,
        loader: "jade"
    }]
},
plugins: [
    new ExtractTextPlugin("main.css"),
    new HtmlWebpackPlugin({
        template: './src/jade/index.jade'
    })
]
};
</code></pre>