title: How to run production site after build vue cli
body: <p>I'm using VueCLI 2 and build as production. THe build.js is built and compiled into 200KB. When I re-run the server as development, it loaded 3MB. I'm sure the build.js inside dist folder is 200KB. I tried to open index.html but it doesn't work and redirect to root directory on website.</p>
  <p><strong>Package.json</strong></p>
  <pre><code>&quot;scripts&quot;: {
    &quot;dev&quot;: &quot;cross-env NODE_ENV=development webpack-dev-server --open --hot&quot;,
    &quot;build&quot;: &quot;cross-env NODE_ENV=production webpack --progress --hide-modules&quot;
  },
  </code></pre>
  <p><strong>Webpack</strong></p>
  <pre><code>module.exports = { ...
  module:{
   ...
   plugins: [
    new webpack.ProvidePlugin({
      $: 'jquery',
      jquery: 'jquery',
      'window.jQuery': 'jquery',
      jQuery: 'jquery'
    })
   ],
   devtool: '#eval-source-map'
  },
  ...
  }
  
  if (process.env.NODE_ENV === 'production') {
    module.exports.devtool = '#source-map'
    // http://vue-loader.vuejs.org/en/workflow/production.html
    module.exports.plugins = (module.exports.plugins || []).concat([
     new webpack.DefinePlugin({
      'process.env': {
       NODE_ENV: '&quot;production&quot;'
     }
    }),
    new webpack.optimize.UglifyJsPlugin({
      sourceMap: true,
      compress: {
       warnings: true
      }
    }),
    new webpack.LoaderOptionsPlugin({
      minimize: true
    }),
    new webpack.optimize.CommonsChunkPlugin({
      name: 'vendor',
      minChunks: function (module) {
        return module.context &amp;&amp; module.context.indexOf('node_modules') !== -1;
      }
    })
   ])
  }
  </code></pre>
  <p><strong>HTML</strong></p>
  <pre><code>&lt;body&gt;
    &lt;script src=&quot;/dist/vendor.js&quot;&gt;&lt;/script&gt;
    &lt;script src=&quot;/dist/main.js&quot;&gt;&lt;/script&gt;
  &lt;/body&gt;
  </code></pre>
  <p><strong>Command</strong></p>
  <blockquote>
  <p>npm run build</p>
  <p>npm run dev</p>
  </blockquote>