fs.writeFileSync(`./compiler.d.ts`,`export * from './types/compiler/index';`);
exportdefault[
/* runtime */
{
@ -59,12 +61,22 @@ export default [
external,
plugins:[
ts_plugin,
dir==='internal'&&{
generateBundle(options,bundle){
constmod=bundle['index.mjs'];
if(mod){
fs.writeFileSync('src/compiler/compile/internal-exports.ts',`// This file is automatically generated\nexport default new Set(${JSON.stringify(mod.exports)});`);
{
writeBundle(bundle){
if(dir==='internal'){
constmod=bundle['index.mjs'];
if(mod){
fs.writeFileSync('src/compiler/compile/internal-exports.ts',`// This file is automatically generated\nexport default new Set(${JSON.stringify(mod.exports)});`);
@ -19,10 +19,10 @@ When building web apps, it's important to make sure that they're *accessible* to
In this case, we're missing the `alt` attribute that describes the image for people using screenreaders, or people with slow or flaky internet connections that can't download the image. Let's add one:
```html
<imgsrc={src}alt="A man dancing">
<imgsrc={src}alt="A man dances.">
```
We can use curly braces *inside* attributes. Try changing it to `"{name} dancing"` — remember to declare a `name` variable in the `<script>` block.
We can use curly braces *inside* attributes. Try changing it to `"{name} dances."` — remember to declare a `name` variable in the `<script>` block.
## Shorthand attributes
@ -30,6 +30,6 @@ We can use curly braces *inside* attributes. Try changing it to `"{name} dancing
It's not uncommon to have an attribute where the name and value are the same, like `src={src}`. Svelte gives us a convenient shorthand for these cases:
You can use similar patterns to replace `pop`, `shift`, `unshift` and `splice`.
> Assignments to *properties* of arrays and objects — e.g. `obj.foo += 1` or `array[i] = x` — work the same way as assignments to the values themselves.
Assignments to *properties* of arrays and objects — e.g. `obj.foo += 1` or `array[i] = x` — work the same way as assignments to the values themselves.