From a9d2170ba2b30ce44a040af31785a2b77b95eba3 Mon Sep 17 00:00:00 2001 From: Rich Harris Date: Sun, 25 Nov 2018 08:30:54 -0500 Subject: [PATCH] shuffle files around --- .gitignore | 4 ++-- src/ssr/register.js => register.js | 12 +++++++----- rollup.config.js | 27 +-------------------------- 3 files changed, 10 insertions(+), 33 deletions(-) rename src/ssr/register.js => register.js (82%) diff --git a/.gitignore b/.gitignore index 02640898d9..930c8dc863 100644 --- a/.gitignore +++ b/.gitignore @@ -1,11 +1,12 @@ .DS_Store .nyc_output node_modules +*.map /cli/ /compiler/ /ssr/ -/shared.js /internal.js +/compiler.js /scratch/ /coverage/ /coverage.lcov/ @@ -14,7 +15,6 @@ node_modules /test/sourcemaps/samples/*/output.js.map /test/sourcemaps/samples/*/output.css /test/sourcemaps/samples/*/output.css.map -/src/compile/shared.ts /store.umd.js /yarn-error.log _actual*.* diff --git a/src/ssr/register.js b/register.js similarity index 82% rename from src/ssr/register.js rename to register.js index fe1fe74c5f..0bd0650112 100644 --- a/src/ssr/register.js +++ b/register.js @@ -1,6 +1,6 @@ -import * as fs from 'fs'; -import * as path from 'path'; -import { compile } from '../index.ts'; +const fs = require('fs'); +const path = require('path'); +const { compile } = require('./compiler.js'); let compileOptions = { extensions: ['.html'] @@ -10,7 +10,7 @@ function capitalise(name) { return name[0].toUpperCase() + name.slice(1); } -export default function register(options) { +function register(options) { if (options.extensions) { compileOptions.extensions.forEach(deregisterExtension); options.extensions.forEach(registerExtension); @@ -42,4 +42,6 @@ function registerExtension(extension) { }; } -registerExtension('.html'); \ No newline at end of file +registerExtension('.html'); + +module.exports = register; \ No newline at end of file diff --git a/rollup.config.js b/rollup.config.js index 898abd0889..b1e5ef4b5b 100644 --- a/rollup.config.js +++ b/rollup.config.js @@ -25,38 +25,13 @@ export default [ }) ], output: { - file: 'compiler/svelte.js', + file: 'compiler.js', format: 'umd', name: 'svelte', sourcemap: true } }, - /* ssr/register.js */ - { - input: 'src/ssr/register.js', - plugins: [ - resolve(), - commonjs(), - buble({ - include: 'src/**', - exclude: 'src/internal/**', - target: { - node: 4 - } - }) - ], - external: [path.resolve('src/index.ts'), 'fs', 'path'], - output: { - file: 'ssr/register.js', - format: 'cjs', - paths: { - [path.resolve('src/index.ts')]: '../compiler/svelte.js' - }, - sourcemap: true - } - }, - /* cli/*.js */ { input: ['src/cli/index.ts'],