diff --git a/tsconfig-webpack.json b/tsconfig-webpack.json index 6601ff48f..7866a330f 100644 --- a/tsconfig-webpack.json +++ b/tsconfig-webpack.json @@ -3,7 +3,8 @@ "module": "commonjs", "target": "es5", "esModuleInterop": true, - "allowJs": true + "allowJs": true, + "resolveJsonModule": true }, "include": ["src/**/*.ts", "src/**/*.tsx", "./typings/**/*.d.ts"] } diff --git a/tsconfig.json b/tsconfig.json index ecb53312f..07ffb9e5c 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -21,6 +21,7 @@ "skipLibCheck": true, "suppressImplicitAnyIndexErrors": true, "strict": true, - "esModuleInterop": true + "esModuleInterop": true, + "resolveJsonModule": true } } diff --git a/webpack.config.ts b/webpack.config.ts index bc99b2d2b..13415a6df 100644 --- a/webpack.config.ts +++ b/webpack.config.ts @@ -5,6 +5,7 @@ import express from 'express' import ErrorOverlayPlugin from 'error-overlay-webpack-plugin' import CopyPlugin from 'copy-webpack-plugin' import TerserPlugin from 'terser-webpack-plugin' +import packageJson from './package.json' module.exports = (env, argv) => { const config = { @@ -59,6 +60,9 @@ module.exports = (env, argv) => { template: 'index.html' }), new ErrorOverlayPlugin(), + new webpack.DefinePlugin({ + 'process.env.VERSION': JSON.stringify(packageJson.version) + }), new webpack.EnvironmentPlugin([ 'NODE_ENV', 'AMPLIFY_AUTH_IDENTITY_POOL_ID',