Skip to content
This repository was archived by the owner on Jan 11, 2023. It is now read-only.

Commit e8773d3

Browse files
authored
Merge pull request #455 from sveltejs/deconflict-server
put server assets in subfolder
2 parents 0826a58 + 01a519a commit e8773d3

File tree

5 files changed

+8
-6
lines changed

5 files changed

+8
-6
lines changed

src/api/export.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ async function execute(emitter: EventEmitter, opts: Opts) {
7171
message: `Crawling ${root.href}`
7272
});
7373

74-
const proc = child_process.fork(path.resolve(`${opts.build}/server.js`), [], {
74+
const proc = child_process.fork(path.resolve(`${opts.build}/server/server.js`), [], {
7575
cwd: process.cwd(),
7676
env: Object.assign({
7777
PORT: port,

src/cli.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ prog.command('build [dest]')
5858
process.env.PORT = process.env.PORT || ${opts.port || 3000};
5959
6060
console.log('Starting server on port ' + process.env.PORT);
61-
require('./server.js');
61+
require('./server/server.js');
6262
`.replace(/^\t+/gm, '').trim());
6363

6464
console.error(`\n> Finished in ${elapsed(start)}. Type ${colors.bold.cyan(`node ${dest}`)} to run the app.`);

src/rollup.ts

+4-2
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,14 @@ export default {
2424

2525
server: {
2626
input: () => {
27-
return `${locations.src()}/server.js`
27+
return {
28+
server: `${locations.src()}/server.js`
29+
};
2830
},
2931

3032
output: () => {
3133
return {
32-
dir: locations.dest(),
34+
dir: `${locations.dest()}/server`,
3335
format: 'cjs',
3436
sourcemap: dev()
3537
};

src/webpack.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ export default {
2929

3030
output: () => {
3131
return {
32-
path: locations.dest(),
32+
path: `${locations.dest()}/server`,
3333
filename: '[name].js',
3434
chunkFilename: '[hash]/[name].[id].js',
3535
libraryTarget: 'commonjs2'

test/common/test.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ function run({ mode, basepath = '' }) {
184184
assert.ok(fs.existsSync('__sapper__/build/index.js'));
185185
}
186186

187-
proc = require('child_process').fork(`${dir}/server.js`, {
187+
proc = require('child_process').fork(`${dir}/server/server.js`, {
188188
cwd: process.cwd(),
189189
env: {
190190
NODE_ENV: mode,

0 commit comments

Comments
 (0)