diff --git a/.gitignore b/.gitignore index b2cc98d..910b5f3 100644 --- a/.gitignore +++ b/.gitignore @@ -12,5 +12,5 @@ sapper runtime.js dist !rollup.config.js -templates/app.mjs -templates/server.mjs \ No newline at end of file +/runtime/app.mjs +/runtime/server.mjs \ No newline at end of file diff --git a/package.json b/package.json index 157a264..4fbd90b 100644 --- a/package.json +++ b/package.json @@ -11,8 +11,8 @@ "config", "sapper", "dist/*.js", - "templates/*.js", - "templates/*.html" + "runtime/*.js", + "runtime/*.html" ], "directories": { "test": "test" @@ -79,7 +79,7 @@ "prepare": "npm run build", "dev": "rollup -cw", "prepublishOnly": "npm test", - "update_mime_types": "curl http://svn.apache.org/repos/asf/httpd/httpd/trunk/docs/conf/mime.types | grep -e \"^[^#]\" > templates/src/server/middleware/mime-types.md" + "update_mime_types": "curl http://svn.apache.org/repos/asf/httpd/httpd/trunk/docs/conf/mime.types | grep -e \"^[^#]\" > runtime/src/server/middleware/mime-types.md" }, "repository": "https://github.com/sveltejs/sapper", "keywords": [ diff --git a/rollup.config.js b/rollup.config.js index da922b8..333082f 100644 --- a/rollup.config.js +++ b/rollup.config.js @@ -14,16 +14,16 @@ const external = [].concat( function template(kind, external) { return { - input: `templates/src/${kind}/index.ts`, + input: `runtime/src/${kind}/index.ts`, output: { - file: `templates/${kind}.mjs`, + file: `runtime/${kind}.mjs`, format: 'es', paths: id => id.replace('@sapper', '.') }, external, plugins: [ resolve({ - extensions: ['.js', '.ts'] + extensions: ['.mjs', '.js', '.ts'] }), commonjs(), string({ @@ -37,8 +37,8 @@ function template(kind, external) { } export default [ - template('app', ['__ROOT__', '__ERROR__', 'svelte', '@sapper/App.html']), - template('server', builtinModules), + template('app', id => /^(svelte\/?|@sapper\/)/.test(id)), + template('server', id => builtinModules.includes(id)), { input: [ @@ -57,7 +57,7 @@ export default [ plugins: [ json(), resolve({ - extensions: ['.js', '.ts'] + extensions: ['.mjs', '.js', '.ts'] }), commonjs(), sucrase({ diff --git a/templates/App.html b/runtime/internal/Sapper.html similarity index 79% rename from templates/App.html rename to runtime/internal/Sapper.html index ed4e3c1..2203d76 100644 --- a/templates/App.html +++ b/runtime/internal/Sapper.html @@ -1,6 +1,6 @@