-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathwebpack.config.js
executable file
·44 lines (43 loc) · 1.25 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
const path = require('path');
const webpack = require('webpack');
const CleanWebpackPlugin = require('clean-webpack-plugin');
module.exports = {
entry: {
app: './src/index.js'
},
output: {
filename: '[name].[hash].js',
path: path.resolve(__dirname, 'dist'),
publicPath: '/'
},
module: {
rules: [
{
test: /\.js$/,
exclude: /(node_modules)/,
use: {
loader: 'babel-loader'
}
}, {
test: /\.(png|svg|jpg|gif|eot|ttf|woff|woff2)$/,
use: [
'file-loader'
]
}
]
},
resolve: {
alias: {
'ROOT': path.join(__dirname, 'src')
}
},
plugins: [
new CleanWebpackPlugin(['dist']),
new webpack.EnvironmentPlugin({
AWS_AMPLIFY_AUTH_IDENTITYPOOLID: process.env.AWS_AMPLIFY_AUTH_IDENTITYPOOLID,
AWS_AMPLIFY_AUTH_USERPOOLID: process.env.AWS_AMPLIFY_AUTH_USERPOOLID,
AWS_AMPLIFY_AUTH_USERPOOL_WEBCLIENT_ID: process.env.AWS_AMPLIFY_AUTH_USERPOOL_WEBCLIENT_ID,
AWS_AMPLIFY_API_ENDPOINT: process.env.AWS_AMPLIFY_API_ENDPOINT
}),
]
};