Skip to content

Commit

Permalink
Fix rollup warning about broken sourcemap (mui#922)
Browse files Browse the repository at this point in the history
By replacing `@class` annotation with `@__PURE__` we broke rollup
internal sourcemap generator.

Found the fix here
https://github.com/ex-machine/rollup-plugin-ts-treeshaking/blob/master/index.js
  • Loading branch information
TrySound authored and dmtrKovalenko committed Feb 18, 2019
1 parent bf6dec1 commit 0ffc2a7
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 17 deletions.
18 changes: 8 additions & 10 deletions lib/package-lock.json

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

11 changes: 4 additions & 7 deletions lib/rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -82,13 +82,10 @@ export default [
nodeResolve({ extensions }),
typescriptPlugin({ typescript, tsconfig }),
babel(babelOptions),
{
transform(code) {
if (code.includes('/** @class */')) {
return code.replace(/\/\*\* @class \*\//g, '/*@__PURE__*/');
}
},
},
replace({
delimiters: ['', ''],
values: { '/** @class */': '/*@__PURE__*/' },
}),
sizeSnapshot(),
],
},
Expand Down

0 comments on commit 0ffc2a7

Please sign in to comment.