UNPKG

1.19 kBJavaScriptView Raw
1module.exports = {
2 entry: {
3 'aws-amplify-react.min': './lib/index.js',
4 },
5 externals: [
6 '@aws-amplify/auth',
7 '@aws-amplify/analytics',
8 '@aws-amplify/api',
9 '@aws-amplify/core',
10 '@aws-amplify/interactions',
11 '@aws-amplify/storage',
12 '@aws-amplify/ui',
13 '@aws-amplify/ui/dist/style.css',
14 '@aws-amplify/xr',
15 'aws-amplify',
16 'react',
17 ],
18 output: {
19 filename: '[name].js',
20 path: __dirname + '/dist',
21 library: 'aws_amplify_react',
22 libraryTarget: 'umd',
23 umdNamedDefine: true,
24 globalObject: 'this',
25 devtoolModuleFilenameTemplate: require('../aws-amplify/webpack-utils')
26 .devtoolModuleFilenameTemplate,
27 },
28 // Enable sourcemaps for debugging webpack's output.
29 devtool: 'source-map',
30 resolve: {
31 extensions: ['.js', '.json'],
32 },
33 mode: 'production',
34 module: {
35 rules: [
36 // All output '.js' files will have any sourcemaps re-processed by 'source-map-loader'.
37 //{ enforce: 'pre', test: /\.js$/, loader: 'source-map-loader' },
38 {
39 test: /\.js?$/,
40 exclude: /node_modules/,
41 use: [
42 'babel-loader',
43 {
44 loader: 'babel-loader',
45 options: {
46 presets: ['@babel/preset-env'],
47 },
48 },
49 ],
50 },
51 ],
52 },
53};