forked from aws/amazon-chime-sdk-js
-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.config.js
73 lines (70 loc) · 1.77 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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
// Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0
/* eslint-disable */
var HtmlWebpackInlineSourcePlugin = require ('html-webpack-inline-source-plugin');
var HtmlWebpackPlugin = require('html-webpack-plugin');
/* eslint-enable */
const app = process.env.npm_config_app || 'meeting';
module.exports = env => {
return {
plugins: [
new HtmlWebpackPlugin({
inlineSource: '.(js|css)$',
template: __dirname + `/app/${app}/${app}.html`,
filename: __dirname + `/dist/${app}.html`,
inject: 'head',
}),
new HtmlWebpackInlineSourcePlugin(),
],
entry: [`./app/${app}/${app}.ts`],
resolve: {
extensions: ['.webpack.js', '.web.js', '.ts', '.tsx', '.js'],
},
output: {
path: __dirname + '/dist',
filename: `${app}-bundle.js`,
publicPath: '/',
libraryTarget: 'var',
library: `app_${app}`,
},
module: {
rules: [
{
test: /\.(svg)$/,
loader: 'raw-loader',
},
{
test: /\.(scss)$/,
use: [{
loader: 'style-loader',
options: {
insert: 'head',
},
}, {
loader: 'css-loader',
}, {
loader: 'postcss-loader',
options: {
plugins: function () {
return [
require('precss'),
require('autoprefixer')
];
},
},
}, {
loader: 'sass-loader',
}]
},
{
test: /\.tsx?$/,
loader: 'awesome-typescript-loader',
},
],
},
mode: 'development',
performance: {
hints: false,
},
};
};