title: How after building the dist folder in Webpack, move the bundle.js and css file into the statics folder?
body: <p>When I run my <code>npm run build</code> or <code>npm run build-dev</code></p>
  
  <p><a href="https://i.stack.imgur.com/hy7Bm.png" rel="noreferrer"><img src="https://i.stack.imgur.com/hy7Bm.png" alt="enter image description here"></a></p>
  
  <p>It creates the index.html and manage2.bundle.js and manage2.css files in the root. I need to move those files into the static directory.</p>
  
  <p>So the generated index.html below will actually work, with the correct paths:</p>
  
  <pre><code>&lt;!doctype html&gt;
  &lt;html lang="en"&gt;
  &lt;head&gt;
      &lt;title&gt;Manage2&lt;/title&gt;
      &lt;meta charset="UTF-8"&gt;
      &lt;meta name="viewport" content="width=device-width, initial-scale=1"&gt;
      &lt;meta http-equiv="X-UA-Compatible" content="IE=edge"&gt;
      &lt;meta name="description" content="The TickerTags backend manage app"&gt;
      &lt;meta name="viewport" content="width=device-width, initial-scale=1"&gt;
      &lt;link rel="stylesheet" href="style.css"&gt;
      &lt;link href="https://fonts.googleapis.com/css?family=Roboto+Condensed:300|Source+Sans+Pro:200,600" rel="stylesheet"&gt;
      &lt;link rel="icon" type="image/x-icon" href="static/favicon.ico"&gt;
  &lt;link href="/static/manage2.css" rel="stylesheet"&gt;&lt;/head&gt;
  &lt;body&gt;
      &lt;div id="manage2"&gt;&lt;/div&gt;
  &lt;script type="text/javascript" src="/static/manage2.bundle.js"&gt;&lt;/script&gt;&lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <h2>How is this acomplished? webpack.config below</h2>
  
  <pre><code>const fs = require('fs');
  const webpack = require('webpack')
  const HtmlWebpackPlugin = require("html-webpack-plugin");
  const ExtractTextPlugin = require("extract-text-webpack-plugin");
  const CopyWebpackPlugin = require("copy-webpack-plugin");
  const path = require("path");
  const dist = path.resolve(__dirname, "dist");
  const src = path.resolve(__dirname, "src");
  const environment = process.env.NODE_ENV;
  
  const stream = fs.createWriteStream("src/services/environment.js");
  stream.once('open', function(fd) {
    stream.write('const env = "'+environment+'"\n');
    stream.write('export default env');
    stream.end();
  });
  
  module.exports = {
    context: src,
    entry: [
      "./index.js"
    ],
    output: {
      path: dist,
      filename: "manage2.bundle.js",
      publicPath: '/static/',
    },
    devtool: 'source-map',
    module: {
      rules: [
        {
          test: /\.jsx?$/,
          exclude: /node_modules/,
          use: ["babel-loader"]
        },
        {
          test: /\.scss$/,
          use: ExtractTextPlugin.extract({
            fallbackLoader: "style-loader",
            loader: ["css-loader", "sass-loader"],
            publicPath: dist
          })
        }
      ]
    },
    devServer: {
      hot: false,
      quiet: true,
      publicPath: "",
      contentBase: path.join(__dirname, "dist"),
      compress: true,
      stats: "errors-only",
      open: true
    },
    plugins: [
      new HtmlWebpackPlugin({
        template: "index.html"
      }),
      new ExtractTextPlugin({
        filename: "manage2.css",
        disable: false,
        allChunks: true
      }),
      new CopyWebpackPlugin([{ from: "static", to: "static" }])
    ]
  };
  // new webpack.DefinePlugin({ env: JSON.stringify(environment) })
  </code></pre>
  
  <h3>My npm scripts</h3>
  
  <pre><code>"scripts": {
      "dev": "NODE_ENV=development webpack-dev-server --history-api-fallback",
      "prod": "NODE_ENV=production webpack-dev-server -p",
      "build": "NODE_ENV=production webpack -p",
      "build-dev": "NODE_ENV=production webpack -d",
  </code></pre>