-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathwebpack.config.js
44 lines (41 loc) · 1.13 KB
/
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
36
37
38
39
40
41
42
43
"use strict";
function configBuilder(dirName){
return {
entry: {
lti: './handler.js'
},
context : dirName,
target: 'node',
module: {
loaders: [
{
test: /.js?$/,
loader: 'babel-loader',
exclude: /node_modules/,
query: {
presets: [
'es2015', // Include all plugins needed to handle es2015 syntax
'stage-3' // Enables experimental ES features.
],
plugins: [
'transform-runtime', // Externalise references to helpers and builtins, automatically polyfilling your code without polluting globals.
'transform-class-properties' // Allows class instance fields and class static properties.
]
}
},
{ test: /\.json$/, loader: "json-loader" }
]
},
externals: ["aws-sdk"],
resolve: {
extensions: ['', '.js', '.json'],
modulesDirectories: ['node_modules']
},
output: {
libraryTarget: 'commonjs',
path: '.webpack',
filename: '[name].js'
}
};
}
module.exports = configBuilder(__dirname);