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

add click plugin js to cdn #1535

Merged
merged 3 commits into from
Apr 19, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
18 changes: 12 additions & 6 deletions extensions/applicationinsights-clickanalytics-js/rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ import { updateDistEsmFiles } from "../../tools/updateDistEsm/updateDistEsm";

const version = require("./package.json").version;
const outputName = "applicationinsights-clickanalytics-js";
const verParts = version.split(".")
if (verParts.length != 3) {
throw "Invalid Version! [" + version + "]"
}
const banner = [
"/*!",
` * Application Insights JavaScript SDK - Click Analytics, ${version}`,
Expand All @@ -30,11 +34,11 @@ function doCleanup() {
})
}

const browserRollupConfigFactory = isProduction => {
const browserRollupConfigFactory = (isProduction, libVersion) => {
const browserRollupConfig = {
input: `dist-esm/${outputName}.js`,
output: {
file: `browser/${outputName}.js`,
file: `browser/ai.clck.${libVersion}.js`,
banner: banner,
format: "umd",
name: "Microsoft.ApplicationInsights",
Expand All @@ -61,7 +65,7 @@ const browserRollupConfigFactory = isProduction => {
};

if (isProduction) {
browserRollupConfig.output.file = `browser/${outputName}.min.js`;
browserRollupConfig.output.file = `browser/ai.clck.${libVersion}.min.js`;
browserRollupConfig.plugins.push(
uglify({
ie8: true,
Expand Down Expand Up @@ -132,8 +136,10 @@ const nodeUmdRollupConfigFactory = (isProduction) => {
updateDistEsmFiles(replaceValues, banner);

export default [
browserRollupConfigFactory(true, version),
browserRollupConfigFactory(false, version),
browserRollupConfigFactory(true, verParts[0]),
browserRollupConfigFactory(false, verParts[0]),
kryalama marked this conversation as resolved.
Show resolved Hide resolved
nodeUmdRollupConfigFactory(true),
nodeUmdRollupConfigFactory(false),
browserRollupConfigFactory(true),
browserRollupConfigFactory(false)
nodeUmdRollupConfigFactory(false)
];
Loading