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

fix: transpile to commonJS instead of es modules #19

Merged
merged 1 commit into from
Jan 7, 2021
Merged

Conversation

vickyyyyyyy
Copy link
Member

Files are currently being built to es modules which give errors when using Jest to run tests for components from other projects which import this:

Screenshot 2021-01-07 at 14 21 34

The above error is normally fixed by adding to transformIgnorePattern to use babel to transpile correctly (in the project which is trying to imprt from ui-enterprise) but this doesn't work for some reason.

Therefore, we are now simplifying this by transpiling to CommonJS instead.

Before (dist/index.js):

/**
 * A library containing the different design components of the Grafana enterprise plugins ecosystem.
 *
 * @packageDocumentation
 */
export * from './components';
//# sourceMappingURL=index.js.map

After (dist/index.js):

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var tslib_1 = require("tslib");
/**
 * A library containing the different design components of the Grafana enterprise plugins ecosystem.
 *
 * @packageDocumentation
 */
tslib_1.__exportStar(require("./components"), exports);
//# sourceMappingURL=index.js.map

@vickyyyyyyy vickyyyyyyy merged commit 239b944 into master Jan 7, 2021
@vickyyyyyyy vickyyyyyyy deleted the commonjs branch January 22, 2021 11:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants