You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

61 lines
1.3 KiB

7 years ago
const webpack = require('webpack');
const GitRevisionPlugin = require('git-revision-webpack-plugin');
const gitRevisionPlugin = new GitRevisionPlugin();
7 years ago
const path = require('path');
7 years ago
function resolve(p) {
return path.resolve(__dirname, './../', p);
7 years ago
}
module.exports = {
target: 'node',
node: {
__dirname: false,
__filename: false,
},
entry: [ 'babel-polyfill', './src/index.ts' ],
7 years ago
output: {
path: resolve('dist')
},
optimization: {
minimize: false
},
7 years ago
plugins: [
new webpack.DefinePlugin({
'GIT_VERSION': JSON.stringify(gitRevisionPlugin.version()),
'GIT_COMMITHASH': JSON.stringify(gitRevisionPlugin.commithash()),
'GIT_BRANCH': JSON.stringify(gitRevisionPlugin.branch()),
})
7 years ago
],
resolve: {
// default `modules` value is `["node_modules"]`
// we change it to resolve `underscore-lodash-wrapper`
modules: [__dirname, 'node_modules'],
extensions: [".ts", ".js"],
alias: {
'any-promise': 'es6-promise',
'underscore': 'underscore-lodash-wrapper'
}
7 years ago
},
stats: {
warningsFilter: [
'mongodb-client-encryption',
'saslprep',
/require_optional/
]
},
7 years ago
module: {
rules: [
{
test: /\.ts$/,
use: [
{ loader: 'babel-loader' },
{ loader: 'ts-loader' }
]
7 years ago
}
]
}
}