From f746031f96e77e14f9251a8660b5ab3c8970e500 Mon Sep 17 00:00:00 2001 From: Richard Harris Date: Mon, 31 Dec 2018 19:56:50 -0500 Subject: [PATCH] tweak some config etc --- easing.mjs | 6 ++---- rollup.config.js | 38 ++++++++++++-------------------------- 2 files changed, 14 insertions(+), 30 deletions(-) diff --git a/easing.mjs b/easing.mjs index 855713b03d..23579da891 100644 --- a/easing.mjs +++ b/easing.mjs @@ -3,6 +3,8 @@ Adapted from https://github.com/mattdesl Distributed under MIT License https://github.com/mattdesl/eases/blob/master/LICENSE.md */ +import { identity as linear } from 'svelte/internal'; + export function backInOut(t) { var s = 1.70158 * 1.525; if ((t *= 2) < 1) return 0.5 * (t * t * ((s + 1) * t - s)); @@ -112,10 +114,6 @@ export function expoOut(t) { return t === 1.0 ? t : 1.0 - Math.pow(2.0, -10.0 * t); } -export function linear(t) { - return t; -} - export function quadInOut(t) { t /= 0.5; if (t < 1) return 0.5 * t * t; diff --git a/rollup.config.js b/rollup.config.js index 9ba2b667ea..6f15775016 100644 --- a/rollup.config.js +++ b/rollup.config.js @@ -52,45 +52,31 @@ export default [ experimentalCodeSplitting: true }, - /* internal.[m]js */ - { - input: 'src/internal/index.js', + /* internal.[m]js, motion.mjs */ + ...['internal', 'motion'].map(name => ({ + input: `src/${name}/index.js`, output: [ { - file: 'internal.mjs', - format: 'esm' - }, - { - file: 'internal.js', - format: 'cjs' - } - ] - }, - - /* motion.[m]js */ - { - input: 'src/motion/index.js', - output: [ - { - file: 'motion.mjs', + file: `${name}.mjs`, format: 'esm', - paths: id => id.replace('svelte', '.') + paths: id => id.startsWith('svelte/') && id.replace('svelte', '.') }, { - file: 'motion.js', + file: `${name}.js`, format: 'cjs', - paths: id => id.replace('svelte', '.') + paths: id => id.startsWith('svelte/') && id.replace('svelte', '.') } ], external: id => id.startsWith('svelte/') - }, + })), - // runtime API - ...['index', 'store', 'easing', 'motion', 'transition'].map(name => ({ + // everything else + ...['index', 'store', 'easing', 'transition'].map(name => ({ input: `${name}.mjs`, output: { file: `${name}.js`, - format: 'cjs' + format: 'cjs', + paths: id => id.startsWith('svelte/') && id.replace('svelte', '.') }, external: id => id !== `${name}.mjs` }))