-
Notifications
You must be signed in to change notification settings - Fork 151
fix: deprecate default export in favor of named export #641
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,7 +4,7 @@ import { prepareContent } from '../modules/prepareContent'; | |
|
||
import type { PreprocessorGroup, Options } from '../types'; | ||
|
||
export default (options?: Options.Babel): PreprocessorGroup => ({ | ||
const babel = (options?: Options.Babel): PreprocessorGroup => ({ | ||
async script(svelteFile) { | ||
const { transformer } = await import('../transformers/babel'); | ||
|
||
|
@@ -26,3 +26,8 @@ export default (options?: Options.Babel): PreprocessorGroup => ({ | |
}; | ||
}, | ||
}); | ||
|
||
// both for backwards compat with old svelte-preprocess versions | ||
// (was only default export once, now is named export because of transpilation causing node not to detect the named exports of 'svelte-preprocess' otherwise) | ||
export default babel; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Do we still need the default export here? IIRC these were re-exported with names in the package entrypoint. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm doing this out of fear that someone may have done There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I find that a tad unlikely, but that's an unfortunately good point 🥲 |
||
export { babel }; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,14 @@ | ||
import type { PreprocessorGroup, Options } from '../types'; | ||
|
||
export default (options: Options.Replace): PreprocessorGroup => ({ | ||
const replace = (options: Options.Replace): PreprocessorGroup => ({ | ||
async markup({ content, filename }) { | ||
const { transformer } = await import('../transformers/replace'); | ||
|
||
return transformer({ content, filename, options }); | ||
}, | ||
}); | ||
|
||
// both for backwards compat with old svelte-preprocess versions | ||
// (was only default export once, now is named export because of transpilation causing node not to detect the named exports of 'svelte-preprocess' otherwise) | ||
export default replace; | ||
export { replace }; |
Uh oh!
There was an error while loading. Please reload this page.