fix(compiler-sfc): fix 'export default' rewrite with extra whitespaces (#4375)
This commit is contained in:
@@ -33,6 +33,48 @@ return { x }
|
||||
export const n = 1"
|
||||
`;
|
||||
|
||||
exports[`SFC compile <script setup> <script> and <script setup> co-usage spaces in ExportDefaultDeclaration node with many spaces and newline 1`] = `
|
||||
"import { x } from './x'
|
||||
|
||||
export const n = 1
|
||||
const __default__ = {
|
||||
some:'option'
|
||||
}
|
||||
|
||||
function setup(__props, { expose }) {
|
||||
|
||||
x()
|
||||
|
||||
return { x }
|
||||
}
|
||||
|
||||
|
||||
export default /*#__PURE__*/ Object.assign(__default__, {
|
||||
setup
|
||||
})"
|
||||
`;
|
||||
|
||||
exports[`SFC compile <script setup> <script> and <script setup> co-usage spaces in ExportDefaultDeclaration node with minimal spaces 1`] = `
|
||||
"import { x } from './x'
|
||||
|
||||
export const n = 1
|
||||
const __default__ = {
|
||||
some:'option'
|
||||
}
|
||||
|
||||
function setup(__props, { expose }) {
|
||||
|
||||
x()
|
||||
|
||||
return { x }
|
||||
}
|
||||
|
||||
|
||||
export default /*#__PURE__*/ Object.assign(__default__, {
|
||||
setup
|
||||
})"
|
||||
`;
|
||||
|
||||
exports[`SFC compile <script setup> defineEmits() 1`] = `
|
||||
"export default {
|
||||
emits: ['foo', 'bar'],
|
||||
|
||||
Reference in New Issue
Block a user