mirror of https://github.com/sveltejs/svelte
parent
6eb720a1b7
commit
76dc216f03
@ -0,0 +1,5 @@
|
||||
---
|
||||
'svelte': patch
|
||||
---
|
||||
|
||||
fix: preprocess `<script>` and `<style>` closed with whitespace before the bracket
|
||||
@ -0,0 +1,8 @@
|
||||
import { test } from '../../test';
|
||||
|
||||
export default test({
|
||||
preprocess: {
|
||||
script: ({ content }) => ({ code: content.replace('__NAME__', 'world') }),
|
||||
style: ({ content }) => ({ code: content.replace('red', 'blue') })
|
||||
}
|
||||
});
|
||||
@ -0,0 +1,11 @@
|
||||
<script>
|
||||
let name = '__NAME__';
|
||||
</script >
|
||||
|
||||
<p>{name}</p>
|
||||
|
||||
<style>
|
||||
p {
|
||||
color: red;
|
||||
}
|
||||
</style >
|
||||
@ -0,0 +1,11 @@
|
||||
<script>
|
||||
let name = 'world';
|
||||
</script>
|
||||
|
||||
<p>{name}</p>
|
||||
|
||||
<style>
|
||||
p {
|
||||
color: blue;
|
||||
}
|
||||
</style>
|
||||
Loading…
Reference in new issue