Skip to content

Commit

Permalink
Make Plexus output ESM (jaegertracing#1219)
Browse files Browse the repository at this point in the history
## Which problem is this PR solving?
Split from jaegertracing#1212

## Short description of the changes
Plexus currently outputs a Universal Module Definition, which seems to
cause issues during the Vite build as it results in "ambiguous exports".
Have Plexus output ESM instead to avoid the issue.

Signed-off-by: Máté Szabó <mszabo@fandom.com>
  • Loading branch information
mszabo-wikia authored Feb 27, 2023
1 parent ec3e089 commit 2c16fa5
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
2 changes: 2 additions & 0 deletions packages/plexus/babel.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ function getBabelConfig(api) {
[
'@babel/preset-env',
{
// Don't transform ES modules
modules: false,
// this should match the settings in jaeger-ui/package.json
targets: ['>0.5%', 'not dead', 'not ie <= 11', 'not op_mini all'],
},
Expand Down
7 changes: 4 additions & 3 deletions packages/plexus/webpack-factory.js
Original file line number Diff line number Diff line change
Expand Up @@ -195,13 +195,14 @@ function makeCommonProdConfig() {
function makeWorkerConfig() {
const layoutDir = join(__dirname, 'src/LayoutManager');
const config = {
experiments: {
outputModule: true,
},
output: {
path: layoutDir,
publicPath: '/',
filename: '[name].bundled.js',
library: 'layout.worker.bundled',
libraryTarget: 'umd',
umdNamedDefine: true,
libraryTarget: 'module',
},
entry: {
'layout.worker': join(layoutDir, 'layout.worker.tsx'),
Expand Down

0 comments on commit 2c16fa5

Please sign in to comment.