@asgardeo/auth-react 0.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/tsconfig.json ADDED
@@ -0,0 +1,26 @@
1
+ {
2
+ "compilerOptions": {
3
+ "esModuleInterop": true,
4
+ "target": "ES6",
5
+ "module": "ESNext",
6
+ "moduleResolution": "node",
7
+ "noImplicitAny": false,
8
+ "jsx": "react",
9
+ "resolveJsonModule": true,
10
+ "sourceMap": true,
11
+ "noLib": false,
12
+ "suppressImplicitAnyIndexErrors": true,
13
+ "experimentalDecorators": true,
14
+ "declaration": true,
15
+ "composite": true,
16
+ "declarationMap": true,
17
+ "baseUrl": "src",
18
+ "paths": {
19
+ "*": ["types/*"]
20
+ },
21
+ "outDir": "./dist",
22
+ "skipLibCheck": true
23
+ },
24
+ "compileOnSave": false,
25
+ "exclude": ["node_modules", "test-configs", "src/**/tests/*", "**/*.test.ts", "**/node_modules"]
26
+ }
@@ -0,0 +1,105 @@
1
+ /**
2
+ * Copyright (c) 2020, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
3
+ *
4
+ * WSO2 Inc. licenses this file to you under the Apache License,
5
+ * Version 2.0 (the "License"); you may not use this file except
6
+ * in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing,
12
+ * software distributed under the License is distributed on an
13
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14
+ * KIND, either express or implied. See the License for the
15
+ * specific language governing permissions and limitations
16
+ * under the License.
17
+ */
18
+
19
+ const path = require("path");
20
+
21
+ // Name of the UMD bundle.
22
+ const LIBRARY_NAME = "AsgardeoAuth";
23
+
24
+ // Flag to enable source maps in production.
25
+ const IS_SOURCE_MAPS_ENABLED_IN_PRODUCTION = false;
26
+
27
+ module.exports = (env) => {
28
+
29
+ // Build Environments.
30
+ const isProduction = env.NODE_ENV === "production";
31
+ const isDevelopment = env.NODE_ENV === "development";
32
+
33
+ return {
34
+ devtool: isProduction
35
+ ? IS_SOURCE_MAPS_ENABLED_IN_PRODUCTION
36
+ ? "source-map"
37
+ : false
38
+ : isDevelopment && "eval-cheap-module-source-map",
39
+ entry: "./src/index.ts",
40
+ externals: [
41
+ {
42
+ "react": {
43
+ root: "React",
44
+ commonjs2: "react",
45
+ commonjs: "react",
46
+ umd: "react"
47
+ },
48
+ "react-dom": {
49
+ root: "ReactDOM",
50
+ commonjs2: "react-dom",
51
+ commonjs: "react-dom",
52
+ umd: "react-dom"
53
+ },
54
+ "react-router-dom": {
55
+ root: "ReactRouter",
56
+ commonjs2: "react-router-dom",
57
+ commonjs: "react-router-dom",
58
+ umd: "react-router-dom"
59
+ }
60
+ }
61
+ ],
62
+ mode: isProduction ? "production" : "development",
63
+ module: {
64
+ rules: [
65
+ {
66
+ test: /\.worker\.ts$/,
67
+ use: {
68
+ loader: "worker-loader",
69
+ options: {
70
+ inline: true
71
+ }
72
+ }
73
+ },
74
+ {
75
+ exclude: /(node_modules|dist)/,
76
+ test: /\.(tsx|jsx|ts|js)?$/,
77
+ use: "babel-loader"
78
+ },
79
+ {
80
+ exclude: /(node_modules|dist)/,
81
+ test: /\.(tsx|jsx|ts?|js)$/,
82
+ use: [
83
+ {
84
+ loader: "eslint-loader",
85
+ options: {
86
+ happyPackMode: true,
87
+ transpileOnly: true
88
+ }
89
+ }
90
+ ]
91
+ }
92
+ ]
93
+ },
94
+ output: {
95
+ filename: "main.js",
96
+ globalObject: "this",
97
+ library: LIBRARY_NAME,
98
+ libraryTarget: "umd",
99
+ path: path.resolve(__dirname, "dist")
100
+ },
101
+ resolve: {
102
+ extensions: [".tsx", ".ts", ".js"]
103
+ }
104
+ }
105
+ };