forked from vercel/vercel
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebpack.config.js
35 lines (34 loc) · 901 Bytes
/
webpack.config.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
// Packages
const nodeExternals = require('webpack-node-externals')
const FlowBabelWebpackPlugin = require('flow-babel-webpack-plugin')
const CopyWebpackPlugin = require('copy-webpack-plugin')
module.exports = {
entry: './src/now.js',
target: 'node',
externals: [nodeExternals()],
devtool: 'source-map',
node: {
__dirname: false
},
output: {
filename: 'dist/now.js',
// this makes sure that the pathnames in the stack traces
// are correct, avoiding a webpack: prefix inside a segment
devtoolModuleFilenameTemplate: '[absolute-resource-path]',
},
module: {
loaders: [
{
test: /\.js$/,
exclude: /node_modules/,
loaders: ['shebang-loader', 'babel-loader']
}
]
},
plugins: [
new FlowBabelWebpackPlugin(),
new CopyWebpackPlugin([
{ from: 'src/serverless/handler.js', to: 'dist/handler.js' }
])
]
}