Skip to content

Commit e944413

Browse files
CopilotMSNev
andauthored
Revert build pipeline changes (package.json, rollup.config.js) per review feedback
Agent-Logs-Url: https://github.com/microsoft/ApplicationInsights-JS/sessions/8e137937-3532-4db1-8985-19dfa2feba8c Co-authored-by: MSNev <54870357+MSNev@users.noreply.github.com>
1 parent a358903 commit e944413

2 files changed

Lines changed: 25 additions & 2 deletions

File tree

examples/cfgSync/package.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,8 @@
3636
"license": "MIT",
3737
"sideEffects": false,
3838
"devDependencies": {
39+
"@microsoft/ai-test-framework": "0.0.1",
40+
"@microsoft/applicationinsights-rollup-plugin-uglify3-js": "1.0.0",
3941
"@microsoft/applicationinsights-rollup-es5": "1.0.2",
4042
"grunt": "^1.6.1",
4143
"grunt-cli": "^1.5.0",

examples/cfgSync/rollup.config.js

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import nodeResolve from "@rollup/plugin-node-resolve";
2+
import { uglify } from "@microsoft/applicationinsights-rollup-plugin-uglify3-js";
23
import replace from "@rollup/plugin-replace";
34
import cleanup from "rollup-plugin-cleanup";
45
import dynamicRemove from "@microsoft/dynamicproto-js/tools/rollup/dist/node/removedynamic";
@@ -31,7 +32,7 @@ function doCleanup() {
3132
})
3233
}
3334

34-
const browserRollupConfigFactory = (name, format = "umd", extension = "") => {
35+
const browserRollupConfigFactory = (name, isProduction, format = "umd", extension = "") => {
3536
const browserRollupConfig = {
3637
input: `dist-es5/${name}.js`,
3738
output: {
@@ -69,11 +70,31 @@ const browserRollupConfigFactory = (name, format = "umd", extension = "") => {
6970
]
7071
};
7172

73+
if (isProduction) {
74+
browserRollupConfig.output.file = `browser/${name}${extension ? "." +extension : ""}.min.js`;
75+
browserRollupConfig.plugins.push(
76+
uglify({
77+
ie8: false,
78+
ie: true,
79+
compress: {
80+
ie: true,
81+
passes:3,
82+
unsafe: true,
83+
},
84+
output: {
85+
ie: true,
86+
preamble: banner,
87+
webkit:true
88+
}
89+
})
90+
);
91+
}
92+
7293
return browserRollupConfig;
7394
};
7495

7596
updateDistEsmFiles(replaceValues, banner);
7697

7798
export default [
78-
browserRollupConfigFactory(workerName, "iife", "gbl")
99+
browserRollupConfigFactory(workerName, false, "iife", "gbl")
79100
];

0 commit comments

Comments
 (0)