Skip to content

JavaScript: Adaptive Card should not assume css-loader/webpack is available on the build pipeline of the host project #2279

@compulim

Description

@compulim

Platform

What platform is your issue or question related to? (Delete other platforms).

  • JavaScript

Author or host

Host

Version of SDK

1.1.2

Issue

In lib/adaptivecards.js, it read

"use strict";
function __export(m) {
    for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];
}
Object.defineProperty(exports, "__esModule", { value: true });
__export(require("./card-elements"));
__export(require("./enums"));
__export(require("./host-config"));
var utils_1 = require("./utils");
exports.SizeAndUnit = utils_1.SizeAndUnit;
exports.getEnumValueOrDefault = utils_1.getEnumValueOrDefault;
require("./adaptivecards-default.css");
//# sourceMappingURL=adaptivecards.js.map

On the very last line, require("./adaptivecards-default.css");, it assume the build pipeline of the project that include Adaptive Cards is on Webpack and have css-loader and style-loader installed.

This will prohibit the use of Adaptive Cards on projects that use rollup.js or other bundling engines that does not support loading CSS in JavaScript.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions