Remove no longer supported import syntax, use CommonJS for tests instead

Using inject-loader requires first transpiling modules to CommonJS. Previously,
we were doing this via parametrized imports, but these are no longer supported.
Instead, we can fix this by using CommonJS preset in Webpack config.

[MAILPOET-5491]
This commit is contained in:
Jan Jakes
2024-06-28 13:29:38 +02:00
committed by Jan Lysý
parent 4ed5ce2ba3
commit 924b01d85c
4 changed files with 18 additions and 11 deletions

View File

@@ -1,6 +1,4 @@
/* (ES6 -> CommonJS transform needed for inject-loader) */
/* eslint-disable-next-line max-len */
import CommunicationInjector from 'inject-loader!babel-loader?plugins[]=@babel/plugin-transform-modules-commonjs!newsletter-editor/components/communication';
import CommunicationInjector from 'inject-loader!newsletter-editor/components/communication';
const expect = global.expect;
const jQuery = global.jQuery;