---
title: Module context
---
So far, our `
```
```html
```
...each counter has its own `count` variable. The code runs once per instance.
Occasionally, you want code to run once *per module* instead. For that, we use `context="module"`:
```html
```
> Don't worry about manually hoisting functions from instance context to module context to avoid creating multiple copies of them — Svelte will do that for you
### Module exports
Any named exports from a `context="module"` script become part of the module's static exports. For example, to define a `preload` function for use with [Sapper](https://sapper.svelte.technology):
```html
```
```js
import BlogPost, { preload } from './BlogPost.html';
```
You can only have named exports — no `export default` — because the component *is* the default export.