Skip to content

Commit

Permalink
fix: adding sourcemaps #49 (#50)
Browse files Browse the repository at this point in the history
* fix: adding sourcemaps #49

* fix: removing prettier
  • Loading branch information
MadaraUchiha-314 authored Apr 5, 2024
1 parent 847b685 commit c325da8
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 90 deletions.
79 changes: 0 additions & 79 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion packages/examples/project-a/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@
"rollup": "3.23.0",
"rollup-plugin-copy": "3.5.0",
"rollup-plugin-module-federation": "*",
"rollup-plugin-prettier": "4.1.1",
"webpack": "5.84.1",
"webpack-cli": "5.1.1",
"@rspack/cli": "0.5.9",
Expand Down
5 changes: 1 addition & 4 deletions packages/examples/project-a/rollup.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import { nodeResolve } from '@rollup/plugin-node-resolve';
import replace from '@rollup/plugin-replace';
import copy from 'rollup-plugin-copy';
import json from '@rollup/plugin-json';
import prettier from 'rollup-plugin-prettier';

import federation from 'rollup-plugin-module-federation';

Expand All @@ -13,6 +12,7 @@ const config = async ({ outputFormat }) => ({
output: {
dir: `dist/rollup/${outputFormat}`,
format: outputFormat,
sourcemap: true,
},
plugins: [
replace({
Expand All @@ -25,9 +25,6 @@ const config = async ({ outputFormat }) => ({
}),
json(),
commonjs(),
prettier({
parser: 'babel',
}),
copy({
targets: [
{
Expand Down
1 change: 0 additions & 1 deletion packages/examples/project-b/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
"rollup": "3.23.0",
"rollup-plugin-copy": "3.5.0",
"rollup-plugin-module-federation": "*",
"rollup-plugin-prettier": "4.1.1",
"webpack": "5.84.1",
"webpack-cli": "5.1.1",
"@rspack/cli": "0.5.9",
Expand Down
5 changes: 1 addition & 4 deletions packages/examples/project-b/rollup.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import { nodeResolve } from '@rollup/plugin-node-resolve';
import replace from '@rollup/plugin-replace';
import copy from 'rollup-plugin-copy';
import json from '@rollup/plugin-json';
import prettier from 'rollup-plugin-prettier';

import federation from 'rollup-plugin-module-federation';

Expand All @@ -13,6 +12,7 @@ const config = ({ outputFormat }) => ({
output: {
dir: `dist/rollup/${outputFormat}`,
format: outputFormat,
sourcemap: true,
},
plugins: [
replace({
Expand All @@ -25,9 +25,6 @@ const config = ({ outputFormat }) => ({
}),
json(),
commonjs(),
prettier({
parser: 'babel',
}),
copy({
targets: [
{
Expand Down
6 changes: 5 additions & 1 deletion packages/rollup-plugin-module-federation/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -566,7 +566,10 @@ export default function federation(
/**
* TODO: We need human readable good code. Atleast until the terser plugin minifies it :p
*/
return remoteEntryCode.toString();
return {
code: remoteEntryCode.toString(),
map: remoteEntryCode.generateMap(),
};
}
return null;
},
Expand Down Expand Up @@ -680,6 +683,7 @@ export default function federation(
}
return {
code: magicString.toString(),
map: magicString.generateMap(),
};
},
},
Expand Down

0 comments on commit c325da8

Please sign in to comment.