Files
sapper/src/webpack.ts
2018-03-17 11:55:02 -04:00

55 lines
880 B
TypeScript

import { locations, dev } from './config';
export default {
dev: dev(),
client: {
entry: () => {
return {
main: `${locations.app()}/client`
};
},
output: () => {
return {
path: `${locations.dest()}/client`,
filename: '[hash]/[name].js',
chunkFilename: '[hash]/[name].[id].js',
publicPath: `client/`
};
}
},
server: {
entry: () => {
return {
server: `${locations.app()}/server`
};
},
output: () => {
return {
path: locations.dest(),
filename: '[name].js',
chunkFilename: '[hash]/[name].[id].js',
libraryTarget: 'commonjs2'
};
}
},
serviceworker: {
entry: () => {
return {
'service-worker': `${locations.app()}/service-worker`
};
},
output: () => {
return {
path: locations.dest(),
filename: '[name].js',
chunkFilename: '[name].[id].[hash].js'
}
}
}
};