put server assets in subfolder

This commit is contained in:
Rich Harris
2018-10-01 15:21:35 -04:00
parent 0826a58995
commit d9ad1d1b10
3 changed files with 7 additions and 5 deletions

View File

@@ -58,7 +58,7 @@ prog.command('build [dest]')
process.env.PORT = process.env.PORT || ${opts.port || 3000};
console.log('Starting server on port ' + process.env.PORT);
require('./server.js');
require('./server');
`.replace(/^\t+/gm, '').trim());
console.error(`\n> Finished in ${elapsed(start)}. Type ${colors.bold.cyan(`node ${dest}`)} to run the app.`);

View File

@@ -24,12 +24,14 @@ export default {
server: {
input: () => {
return `${locations.src()}/server.js`
return {
index: `${locations.src()}/server.js`
};
},
output: () => {
return {
dir: locations.dest(),
dir: `${locations.dest()}/server`,
format: 'cjs',
sourcemap: dev()
};

View File

@@ -23,13 +23,13 @@ export default {
server: {
entry: () => {
return {
server: `${locations.src()}/server`
index: `${locations.src()}/server`
};
},
output: () => {
return {
path: locations.dest(),
path: `${locations.dest()}/server`,
filename: '[name].js',
chunkFilename: '[hash]/[name].[id].js',
libraryTarget: 'commonjs2'