expose ESM and CJS versions of runtime code (#1886)

pull/1893/head
Conduitry 6 years ago
parent b40c15349c
commit 82c247ea3e

9
.gitignore vendored

@ -3,10 +3,10 @@
node_modules
*.map
/cli/
/compiler/
/ssr/
/internal.js
/compiler.js
/index.js
/internal.*
/store.js
/scratch/
/coverage/
/coverage.lcov/
@ -15,7 +15,6 @@ node_modules
/test/sourcemaps/samples/*/output.js.map
/test/sourcemaps/samples/*/output.css
/test/sourcemaps/samples/*/output.css.map
/store.umd.js
/yarn-error.log
_actual*.*
_*/
_*/

@ -4,4 +4,4 @@ export {
beforeUpdate,
afterUpdate,
createEventDispatcher
} from './internal.js';
} from './internal';

@ -2,6 +2,7 @@
"name": "svelte",
"version": "3.0.0-alpha6",
"description": "The magical disappearing UI framework",
"module": "index.mjs",
"main": "index.js",
"bin": {
"svelte": "svelte"
@ -10,9 +11,9 @@
"cli",
"compiler.js",
"register.js",
"index.js",
"internal.js",
"store.js",
"index.*",
"internal.*",
"store.*",
"svelte",
"README.md"
],

@ -1,14 +1,12 @@
import path from 'path';
import replace from 'rollup-plugin-replace';
import resolve from 'rollup-plugin-node-resolve';
import commonjs from 'rollup-plugin-commonjs';
import json from 'rollup-plugin-json';
import typescript from 'rollup-plugin-typescript';
import buble from 'rollup-plugin-buble';
import pkg from './package.json';
export default [
/* compiler/svelte.js */
/* compiler.js */
{
input: 'src/index.ts',
plugins: [
@ -54,12 +52,38 @@ export default [
experimentalCodeSplitting: true
},
/* internal.js */
/* index.js */
{
input: 'index.mjs',
output: {
file: 'index.js',
format: 'cjs'
},
external: name => name !== 'index.mjs'
},
/* internal.[m]js */
{
input: 'src/internal/index.js',
output: [
{
file: 'internal.mjs',
format: 'esm'
},
{
file: 'internal.js',
format: 'cjs'
}
]
},
/* store.js */
{
input: 'store.mjs',
output: {
file: 'internal.js',
format: 'es'
}
}
file: 'store.js',
format: 'cjs'
},
external: name => name !== 'store.mjs'
},
];

@ -1,4 +1,4 @@
import { run_all, noop } from './internal.js';
import { run_all, noop } from './internal';
export function readable(start, value) {
const subscribers = [];
Loading…
Cancel
Save