expose svelte/ssr which have noop for lifecycle events (#6416)

pull/6470/head
Tan Li Hau 4 years ago committed by GitHub
parent eadb83b934
commit e7af4d7706
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

1
.gitignore vendored

@ -8,6 +8,7 @@ node_modules
/compiler.d.ts
/compiler.*js
/index.*js
/ssr.*js
/internal
/store
/easing

@ -54,6 +54,10 @@
"./transition": {
"import": "./transition/index.mjs",
"require": "./transition/index.js"
},
"./ssr": {
"import": "./ssr.mjs",
"require": "./ssr.js"
}
},
"engines": {

@ -42,6 +42,24 @@ export default [
plugins: [ts_plugin]
},
{
input: `src/runtime/ssr.ts`,
output: [
{
file: `ssr.mjs`,
format: 'esm',
paths: id => id.startsWith('svelte/') && `${id.replace('svelte', '.')}/index.mjs`
},
{
file: `ssr.js`,
format: 'cjs',
paths: id => id.startsWith('svelte/') && `${id.replace('svelte', '.')}/index.js`
}
],
external,
plugins: [ts_plugin]
},
...fs.readdirSync('src/runtime')
.filter(dir => fs.statSync(`src/runtime/${dir}`).isDirectory())
.map(dir => ({

@ -0,0 +1,14 @@
export {
setContext,
getContext,
hasContext,
tick,
createEventDispatcher,
SvelteComponent,
SvelteComponentTyped
} from './index';
export function onMount() {}
export function onDestroy() {}
export function beforeUpdate() {}
export function afterUpdate() {}
Loading…
Cancel
Save