Created
October 4, 2017 12:54
-
-
Save Pierre-RA/da6237137e2e63b9905406db600c953c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var fs = require('fs'); | |
var nodeModules = {}; | |
fs.readdirSync('node_modules') | |
.filter(function(x) { | |
return ['.bin'].indexOf(x) === -1; | |
}) | |
.forEach(function(mod) { | |
nodeModules[mod] = 'commonjs ' + mod; | |
}); | |
module.exports = { | |
entry: './server/server.ts', | |
output: { | |
path: __dirname + '/dist', | |
filename: 'server.js', | |
}, | |
resolve: { | |
// Add '.ts' and '.tsx' as a resolvable extension. | |
extensions: ['.webpack.js', '.web.js', '.ts', '.tsx', '.js'], | |
}, | |
module: { | |
loaders: [ | |
// All files with a '.ts' or '.tsx' | |
// extension will be handled by 'ts-loader' | |
{ | |
test: /\.tsx?$/, | |
loader: 'ts-loader', | |
}, | |
], | |
}, | |
target: 'node', | |
externals: nodeModules, | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment