Skip to content

Commit a094779

Browse files
committed
fix: vite makes builds different
- Somehow there is a difference on my localhost for a consuming app using vite, because that one need the `default` unpack. - Tests pass, because they use webpack, IMO.
1 parent 2b2ab8e commit a094779

File tree

1 file changed

+8
-9
lines changed

1 file changed

+8
-9
lines changed

ember-highcharts/src/components/high-charts.ts

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -203,20 +203,19 @@ export default class HighCharts<
203203
* Dynamically imports the necessary pieces from Highcharts, based on chart type and options.
204204
*/
205205
async _importHighchartsDeps() {
206+
let tmpModule;
207+
206208
if (this.args.mode === 'Map') {
207-
//@ts-expect-error No idea, sielnt TS
208-
this.highchartsInstance = await waitForPromise(
209-
import('highcharts/modules/map'),
210-
);
209+
tmpModule = await waitForPromise(import('highcharts/modules/map'));
211210
} else if (this.args.mode === 'StockChart') {
212-
//@ts-expect-error No idea, sielnt TS
213-
this.highchartsInstance = await waitForPromise(
214-
import('highcharts/modules/stock'),
215-
);
211+
tmpModule = await waitForPromise(import('highcharts/modules/stock'));
216212
} else {
217-
this.highchartsInstance = await waitForPromise(import('highcharts'));
213+
tmpModule = await waitForPromise(import('highcharts'));
218214
}
219215

216+
// @ts-expect-error No idea what TS wants
217+
this.highchartsInstance = tmpModule.default || tmpModule;
218+
220219
await waitForPromise(import('highcharts/modules/accessibility'));
221220

222221
// 3d support

0 commit comments

Comments
 (0)