<p dir="auto"><strong>Do you want to request a <em>feature</em> or report a <em>bug</em>?</strong><br>
<em>documentation</em></p>


<p dir="auto"><strong>What is the current behavior?</strong><br>
I've spent quite some time trying to figure out what is the exact configuration that is used when <code class="notranslate">mode</code> is set to <code class="notranslate">production</code>, but haven't found a clear answer yet.</p>
<p dir="auto">I need to tweak a single config option (<code class="notranslate">collapse_vars</code>) for the <code class="notranslate">UglifyJsPlugin</code> and, as far as I see, there is no way to do it, except for setting <code class="notranslate">mode</code> to <code class="notranslate">none</code> and explicitly re-defining the whole production config, having the only difference from the default <code class="notranslate">production</code> config that <code class="notranslate">UglifyJsPlugin.uglifyOptions.collapse_vars = false</code>. But how do I know the default production config? I can't find it in the documentation, so I'm trying to find this out by trial and errors, which is totally counter-productive.</p>
<p dir="auto"><strong>If the current behavior is a bug, please provide the steps to reproduce.</strong></p>



<p dir="auto"><strong>What is the expected behavior?</strong><br>
It would be great if on this page <a href="https://webpack.js.org/concepts/mode/" rel="nofollow">https://webpack.js.org/concepts/mode/</a>, instead of some weird diffs there were full and exact configs that are equivalent to setting <code class="notranslate">mode</code> to <code class="notranslate">development</code> or <code class="notranslate">production</code>.</p>
<p dir="auto"><strong>If this is a feature request, what is motivation or use case for changing the behavior?</strong><br>
The user should be able to easily copy-and-paste the default config and tweak it to their needs.</p>
<p dir="auto"><strong>Please mention other relevant information such as the browser version, Node.js version, webpack version, and Operating System.</strong></p>
<p dir="auto">ERROR in Entry module not found: SyntaxError: D:\ProjectPath\package.json (directory description file): SyntaxError: Unexpected token</p>
<h2 dir="auto"><strong>webpack.config.js</strong></h2>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="module.exports = {
    context: __dirname,
    entry: 'main.ts',
    output: {
        path: __dirname + '/Builds/js',
        filename: 'all.js'
    },
    resolve: {
        extensions: ['', '.js', '.ts']
    },
    module: {
        loaders: [
          {
              test: /\.ts$/,
              loader: 'ts'
          },
          {
              test: /\.json$/,
              loader: &quot;json&quot;
          }
        ]
    }
};"><pre class="notranslate"><span class="pl-smi">module</span><span class="pl-kos">.</span><span class="pl-c1">exports</span> <span class="pl-c1">=</span> <span class="pl-kos">{</span>
    <span class="pl-c1">context</span>: <span class="pl-s1">__dirname</span><span class="pl-kos">,</span>
    <span class="pl-c1">entry</span>: <span class="pl-s">'main.ts'</span><span class="pl-kos">,</span>
    <span class="pl-c1">output</span>: <span class="pl-kos">{</span>
        <span class="pl-c1">path</span>: <span class="pl-s1">__dirname</span> <span class="pl-c1">+</span> <span class="pl-s">'/Builds/js'</span><span class="pl-kos">,</span>
        <span class="pl-c1">filename</span>: <span class="pl-s">'all.js'</span>
    <span class="pl-kos">}</span><span class="pl-kos">,</span>
    <span class="pl-c1">resolve</span>: <span class="pl-kos">{</span>
        <span class="pl-c1">extensions</span>: <span class="pl-kos">[</span><span class="pl-s">''</span><span class="pl-kos">,</span> <span class="pl-s">'.js'</span><span class="pl-kos">,</span> <span class="pl-s">'.ts'</span><span class="pl-kos">]</span>
    <span class="pl-kos">}</span><span class="pl-kos">,</span>
    <span class="pl-c1">module</span>: <span class="pl-kos">{</span>
        <span class="pl-c1">loaders</span>: <span class="pl-kos">[</span>
          <span class="pl-kos">{</span>
              <span class="pl-c1">test</span>: <span class="pl-pds"><span class="pl-c1">/</span><span class="pl-cce">\.</span>ts<span class="pl-cce">$</span><span class="pl-c1">/</span></span><span class="pl-kos">,</span>
              <span class="pl-c1">loader</span>: <span class="pl-s">'ts'</span>
          <span class="pl-kos">}</span><span class="pl-kos">,</span>
          <span class="pl-kos">{</span>
              <span class="pl-c1">test</span>: <span class="pl-pds"><span class="pl-c1">/</span><span class="pl-cce">\.</span>json<span class="pl-cce">$</span><span class="pl-c1">/</span></span><span class="pl-kos">,</span>
              <span class="pl-c1">loader</span>: <span class="pl-s">"json"</span>
          <span class="pl-kos">}</span>
        <span class="pl-kos">]</span>
    <span class="pl-kos">}</span>
<span class="pl-kos">}</span><span class="pl-kos">;</span></pre></div>
<h2 dir="auto"><strong>package.json</strong></h2>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="{
    &quot;version&quot;: &quot;1.0.0&quot;,
    &quot;name&quot;: &quot;RevenueTracker&quot;,
    &quot;description&quot;: &quot;A angular 2 app&quot;,    
    &quot;scripts&quot;: {
        &quot;build&quot;: &quot;webpack&quot;,
        &quot;typings&quot;: &quot;typings&quot;,
        &quot;preinstall&quot;: &quot;npm i -g bower&quot;,
        &quot;postinstall&quot;: &quot;typings install&quot;
    },
    &quot;dependencies&quot;: {
        &quot;jquery&quot;: &quot;~1.11.3&quot;,
        &quot;@angular/common&quot;: &quot;2.0.0-rc.1&quot;,
        &quot;@angular/compiler&quot;: &quot;2.0.0-rc.1&quot;,
        &quot;@angular/core&quot;: &quot;2.0.0-rc.1&quot;,
        &quot;@angular/http&quot;: &quot;2.0.0-rc.1&quot;,
        &quot;@angular/platform-browser&quot;: &quot;2.0.0-rc.1&quot;,
        &quot;@angular/platform-browser-dynamic&quot;: &quot;2.0.0-rc.1&quot;,
        &quot;@angular/router&quot;: &quot;2.0.0-rc.1&quot;,
        &quot;@angular/router-deprecated&quot;: &quot;2.0.0-rc.1&quot;,
        &quot;@angular/upgrade&quot;: &quot;2.0.0-rc.1&quot;,
        &quot;systemjs&quot;: &quot;0.19.26&quot;,
        &quot;es6-shim&quot;: &quot;^0.35.0&quot;,
        &quot;reflect-metadata&quot;: &quot;0.1.2&quot;,
        &quot;rxjs&quot;: &quot;5.0.0-beta.6&quot;,
        &quot;zone.js&quot;: &quot;^0.6.12&quot;,
        &quot;highcharts&quot;: &quot;^4.2.3&quot;,
        &quot;ng2-highcharts&quot;: &quot;^0.3.4&quot;,
        &quot;moment&quot;: &quot;^2.13.0&quot;
    },
    &quot;devDependencies&quot;: {
        &quot;typescript&quot;: &quot;^1.8.0&quot;,
        &quot;typings&quot;: &quot;^0.7.12&quot;,
        &quot;gulp&quot;: &quot;3.9.0&quot;,
        &quot;gulp-bower&quot;: &quot;^0.0.13&quot;,
        &quot;gulp-uglify&quot;: &quot;1.5.1&quot;,
        &quot;gulp-concat&quot;: &quot;2.6.0&quot;,
        &quot;gulp-sourcemaps&quot;: &quot;1.6.0&quot;,
        &quot;require-dir&quot;: &quot;0.3.0&quot;,
        &quot;webpack&quot;: &quot;^1.12.14&quot;,
        &quot;webpack-merge&quot;: &quot;^0.9.0&quot;,
        &quot;file-loader&quot;: &quot;^0.8.5&quot;,
        &quot;ts-loader&quot;: &quot;^0.8.1&quot;,
        &quot;json-loader&quot;: &quot;0.5.4&quot;
    }
}"><pre class="notranslate"><span class="pl-kos">{</span>
    <span class="pl-s">"version"</span>: <span class="pl-s">"1.0.0"</span><span class="pl-kos">,</span>
    <span class="pl-s">"name"</span>: <span class="pl-s">"RevenueTracker"</span><span class="pl-kos">,</span>
    <span class="pl-s">"description"</span>: <span class="pl-s">"A angular 2 app"</span><span class="pl-kos">,</span>    
    <span class="pl-s">"scripts"</span>: <span class="pl-kos">{</span>
        <span class="pl-s">"build"</span>: <span class="pl-s">"webpack"</span><span class="pl-kos">,</span>
        <span class="pl-s">"typings"</span>: <span class="pl-s">"typings"</span><span class="pl-kos">,</span>
        <span class="pl-s">"preinstall"</span>: <span class="pl-s">"npm i -g bower"</span><span class="pl-kos">,</span>
        <span class="pl-s">"postinstall"</span>: <span class="pl-s">"typings install"</span>
    <span class="pl-kos">}</span><span class="pl-kos">,</span>
    <span class="pl-s">"dependencies"</span>: <span class="pl-kos">{</span>
        <span class="pl-s">"jquery"</span>: <span class="pl-s">"~1.11.3"</span><span class="pl-kos">,</span>
        <span class="pl-s">"@angular/common"</span>: <span class="pl-s">"2.0.0-rc.1"</span><span class="pl-kos">,</span>
        <span class="pl-s">"@angular/compiler"</span>: <span class="pl-s">"2.0.0-rc.1"</span><span class="pl-kos">,</span>
        <span class="pl-s">"@angular/core"</span>: <span class="pl-s">"2.0.0-rc.1"</span><span class="pl-kos">,</span>
        <span class="pl-s">"@angular/http"</span>: <span class="pl-s">"2.0.0-rc.1"</span><span class="pl-kos">,</span>
        <span class="pl-s">"@angular/platform-browser"</span>: <span class="pl-s">"2.0.0-rc.1"</span><span class="pl-kos">,</span>
        <span class="pl-s">"@angular/platform-browser-dynamic"</span>: <span class="pl-s">"2.0.0-rc.1"</span><span class="pl-kos">,</span>
        <span class="pl-s">"@angular/router"</span>: <span class="pl-s">"2.0.0-rc.1"</span><span class="pl-kos">,</span>
        <span class="pl-s">"@angular/router-deprecated"</span>: <span class="pl-s">"2.0.0-rc.1"</span><span class="pl-kos">,</span>
        <span class="pl-s">"@angular/upgrade"</span>: <span class="pl-s">"2.0.0-rc.1"</span><span class="pl-kos">,</span>
        <span class="pl-s">"systemjs"</span>: <span class="pl-s">"0.19.26"</span><span class="pl-kos">,</span>
        <span class="pl-s">"es6-shim"</span>: <span class="pl-s">"^0.35.0"</span><span class="pl-kos">,</span>
        <span class="pl-s">"reflect-metadata"</span>: <span class="pl-s">"0.1.2"</span><span class="pl-kos">,</span>
        <span class="pl-s">"rxjs"</span>: <span class="pl-s">"5.0.0-beta.6"</span><span class="pl-kos">,</span>
        <span class="pl-s">"zone.js"</span>: <span class="pl-s">"^0.6.12"</span><span class="pl-kos">,</span>
        <span class="pl-s">"highcharts"</span>: <span class="pl-s">"^4.2.3"</span><span class="pl-kos">,</span>
        <span class="pl-s">"ng2-highcharts"</span>: <span class="pl-s">"^0.3.4"</span><span class="pl-kos">,</span>
        <span class="pl-s">"moment"</span>: <span class="pl-s">"^2.13.0"</span>
    <span class="pl-kos">}</span><span class="pl-kos">,</span>
    <span class="pl-s">"devDependencies"</span>: <span class="pl-kos">{</span>
        <span class="pl-s">"typescript"</span>: <span class="pl-s">"^1.8.0"</span><span class="pl-kos">,</span>
        <span class="pl-s">"typings"</span>: <span class="pl-s">"^0.7.12"</span><span class="pl-kos">,</span>
        <span class="pl-s">"gulp"</span>: <span class="pl-s">"3.9.0"</span><span class="pl-kos">,</span>
        <span class="pl-s">"gulp-bower"</span>: <span class="pl-s">"^0.0.13"</span><span class="pl-kos">,</span>
        <span class="pl-s">"gulp-uglify"</span>: <span class="pl-s">"1.5.1"</span><span class="pl-kos">,</span>
        <span class="pl-s">"gulp-concat"</span>: <span class="pl-s">"2.6.0"</span><span class="pl-kos">,</span>
        <span class="pl-s">"gulp-sourcemaps"</span>: <span class="pl-s">"1.6.0"</span><span class="pl-kos">,</span>
        <span class="pl-s">"require-dir"</span>: <span class="pl-s">"0.3.0"</span><span class="pl-kos">,</span>
        <span class="pl-s">"webpack"</span>: <span class="pl-s">"^1.12.14"</span><span class="pl-kos">,</span>
        <span class="pl-s">"webpack-merge"</span>: <span class="pl-s">"^0.9.0"</span><span class="pl-kos">,</span>
        <span class="pl-s">"file-loader"</span>: <span class="pl-s">"^0.8.5"</span><span class="pl-kos">,</span>
        <span class="pl-s">"ts-loader"</span>: <span class="pl-s">"^0.8.1"</span><span class="pl-kos">,</span>
        <span class="pl-s">"json-loader"</span>: <span class="pl-s">"0.5.4"</span>
    <span class="pl-kos">}</span>
<span class="pl-kos">}</span></pre></div>
<p dir="auto">I don't find any syntax error in package.json<br>
I am trying from a long time but the same error exist. You will notice i have given absolute path for the entry as</p>
<p dir="auto">entry: 'main.ts',</p>
<p dir="auto">when i give relative path <strong>(entry: './main')</strong>  it gives error<br>
ERROR in Entry module not found: Error: Cannot resolve 'file' or 'directory' ./main in D:\ProjectPath</p>
<p dir="auto">Then it resolves the path for main.ts and finally gives the error as mentioned above.<br>
<strong>ERROR in Entry module not found: SyntaxError: D:\ProjectPath\package.json (directory description file): SyntaxError: Unexpected token</strong></p>
<p dir="auto">This is very strange behavior. Please let me know if anybody found same issue and how did u resolve?</p>
<p dir="auto">Thank you.</p>