Webpack external not cacheable : <p>I'm using webpack to bundle node.js web server based on Express.js framework.</p>

<p>Webpack build works fine, but at the end it gives me two red messages:</p>

<p>[1] external "express" 42 bytes {0} [not cacheable]</p>

<p>[2] external "path" 42 bytes {0} [not cacheable]</p>

<p>What does that mean and should I fix it? If yes then how to fix it?</p>

<p>My webpack config is here:</p>

<pre><code>var server = {  
  devtool: 'source-map',
  entry: './src/server.ts',
  target: 'node',

  // Config for our build files
  output: {
    path: root('dist/server'),
    filename: '[name].bundle.js',
    sourceMapFilename: '[name].map',
    chunkFilename: '[id].chunk.js'
  },

  externals: nodeModules,  

  module: {
    preLoaders: [
      // { test: /\.ts$/, loader: 'tslint-loader', exclude: [ root('node_modules') ] },
      // TODO(gdi2290): `exclude: [ root('node_modules/rxjs') ]` fixed with rxjs 5 beta.2 release
      { test: /\.js$/, loader: "source-map-loader", exclude: [ root('node_modules/rxjs') ] }
    ],
    loaders: [
      // Support for .ts files.
      { test: /\.ts$/, loader: 'ts-loader', exclude: [ /\.(spec|e2e|async)\.ts$/ ] }
    ]
  },

  plugins: [
    new webpack.optimize.OccurenceOrderPlugin(true),
    // replace
    new webpack.DefinePlugin({
      'process.env': {
        'ENV': JSON.stringify(metadata.ENV),
        'NODE_ENV': JSON.stringify(metadata.ENV)
      }
    })
  ],

};
</code></pre>

<p>My server.ts module:</p>

<pre><code>console.log('Starting web server...');

import * as path from 'path';
import * as express from 'express';

let app = express();
let root = path.join(path.resolve(__dirname, '..'));

var port = process.env.PORT || 8080;        // set our port
var router = express.Router();

router.get('/', function(req, res) {
    res.json({ message: 'hooray! welcome to our api!' });   
});

app.use('/api', router);

app.listen(port);
console.log('Server started on port ' + port);
</code></pre>
