-
Notifications
You must be signed in to change notification settings - Fork 1
/
webpack.config.js
54 lines (44 loc) · 1.28 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
44
45
46
47
48
49
50
51
52
53
54
// Get AWS Credential
const config = require(`${process.env.HOME}/.aws/config.json`);
const webpack = require('webpack');
const path = require('path');
const rootPath = path.resolve(__dirname);
const wwwPath = path.resolve(rootPath, 'www');
module.exports = {
context: wwwPath,
entry: './index.ts',
output: {
path: wwwPath,
filename: 'bundle.js',
},
devServer: {
contentBase: wwwPath,
},
module: {
noParse: [/aws-sdk/],
loaders: [
// auth0-lock
// { test: /node_modules\/auth0-lock\/.*\.js$/,
// loaders: [
// 'transform/cacheable?brfs',
// 'transform/cacheable?packageify'
// ]
// }, {
// test: /node_modules\/auth0-lock\/.*\.ejs$/,
// loader: 'transform/cacheable?ejsify'
// },
// { test: /aws-sdk*browser/, loader: 'transform?brfs' },
{ test: /\.json$/, loader: 'json' },
{ test: /\.css$/, loader: 'style!css' },
{ test: /\.ts(x?)$/, loader: 'babel!awesome-typescript' },
{ test: /\.html$/, loader: 'raw' },
],
},
plugins: [
new webpack.DefinePlugin({
ON_TEST: process.env.NODE_ENV === 'test',
ACCESS_KEY_ID: JSON.stringify(config.accessKeyId),
SECRET_ACCESS_KEY: JSON.stringify(config.secretAccessKey),
}),
],
};