Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bundle msal-common into msal-browser #5932

Closed
wants to merge 15 commits into from
Closed
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion lib/msal-browser/jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,8 @@ module.exports = {
url: "https://localhost:8081/index.html"
},
collectCoverageFrom: ["src/**/*.ts"],
coverageReporters: [["lcov", {"projectRoot": "../../"}]]
coverageReporters: [["lcov", { "projectRoot": "../../" }]],
moduleNameMapper: {
'^@azure/msal-common$': '<rootDir>/../msal-common/src'
}
};
14 changes: 3 additions & 11 deletions lib/msal-browser/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 3 additions & 4 deletions lib/msal-browser/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@
"build:modules": "rollup -c --strictDeprecations --bundleConfigAsCjs",
"build:modules:watch": "rollup -cw --bundleConfigAsCjs",
"build": "npm run clean && npm run build:modules",
"link:localDeps": "npx lerna bootstrap --scope @azure/msal-common --scope @azure/msal-browser",
"prepack": "npm run build:all",
"format:check": "npx prettier --ignore-path .gitignore --check src test",
"format:fix": "npx prettier --ignore-path .gitignore --write src test"
Expand Down Expand Up @@ -90,7 +89,7 @@
"tslint": "^5.20.0",
"typescript": "^4.9.5"
},
"dependencies": {
"@azure/msal-common": "^12.0.0"
}
"bundledDependencies": [
"@azure/msal-common"
]
}
15 changes: 4 additions & 11 deletions lib/msal-browser/rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ const fileHeader = `${libraryHeader}\n${useStrictHeader}`;
export default [
{
// for es build
input: "src/index.ts",
input: ["src/index.ts", "../msal-common/src/index.ts"],
output: {
dir: "dist",
preserveModules: true,
Expand All @@ -40,21 +40,14 @@ export default [
]
},
{
input: "src/index.ts",
input: ["src/index.ts", "../msal-common/src/index.ts"],
preserveModules: false,
output: [
{
dir: "lib",
format: "cjs",
banner: fileHeader,
sourcemap: true,
},
{
dir: "lib",
hectormmg marked this conversation as resolved.
Show resolved Hide resolved
format: "umd",
name: "msal",
banner: fileHeader,
sourcemap: true,
}
],
plugins: [
Expand All @@ -66,7 +59,7 @@ export default [
typescript: require("typescript"),
tsconfig: "tsconfig.build.json",
sourceMap: true,
compilerOptions: {outDir: "./lib"}
compilerOptions: { outDir: "./lib" }
})
]
},
Expand All @@ -91,7 +84,7 @@ export default [
typescript: require("typescript"),
tsconfig: "tsconfig.build.json",
sourceMap: false,
compilerOptions: {outDir: "./lib"}
compilerOptions: { outDir: "./lib" }
}),
terser({
output: {
Expand Down
3 changes: 2 additions & 1 deletion lib/msal-browser/tsconfig.base.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"extends": "../../tsconfig.json",
"compilerOptions": {
"suppressImplicitAnyIndexErrors": true,
"sourceMap": true,
Expand All @@ -13,4 +14,4 @@
},
"compileOnSave": false,
"buildOnSave": false
}
}
15 changes: 13 additions & 2 deletions lib/msal-browser/tsconfig.build.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,18 @@
{
"extends": "./tsconfig.json",
"compilerOptions": {
"rootDir": "./src"
"rootDirs": [
"./src",
"../msal-common/src"
],
"paths": {
"@azure/msal-common": [
"../msal-common/src"
]
}
},
"include": ["src"]
"include": [
"src",
"../msal-common/src"
]
}
24 changes: 21 additions & 3 deletions lib/msal-browser/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,19 +13,37 @@
"allowUnusedLabels": false,
"noImplicitReturns": true,
"esModuleInterop": true,
"resolveJsonModule": true
"resolveJsonModule": true,
"strictPropertyInitialization": false,
"rootDirs": [
"./",
"../msal-common"
],
"baseUrl": "./",
"paths": {
"*": [
"src/*",
"node_modules/"
],
"@azure/msal-common": [
"../msal-common/src"
]
}
},
"references": [
{
"path": "../msal-common"
}
],
"include": ["src", "test"],
"include": [
"src",
"test"
],
"exclude": [
"node_modules"
],
"types": [
"node",
"jest"
]
}
}