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

Commit

Permalink
rollup sourcemap adjustments
Browse files Browse the repository at this point in the history
  • Loading branch information
teoxoy authored and Conduitry committed Jul 29, 2019
1 parent 845c54b commit c653eef
Showing 1 changed file with 13 additions and 9 deletions.
22 changes: 13 additions & 9 deletions src/config/rollup.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,17 @@
import { dev, src, dest } from './env';
import { InputOption, OutputOptions } from 'rollup';

const sourcemap = dev ? 'inline' : false;

export default {
dev,

client: {
input: () => {
input: (): InputOption => {
return `${src}/client.js`
},

output: () => {
output: (): OutputOptions => {
let dir = `${dest}/client`;
if (process.env.SAPPER_LEGACY_BUILD) dir += `/legacy`;

Expand All @@ -17,36 +20,37 @@ export default {
entryFileNames: '[name].[hash].js',
chunkFileNames: '[name].[hash].js',
format: 'esm',
sourcemap: dev
sourcemap
};
}
},

server: {
input: () => {
input: (): InputOption => {
return {
server: `${src}/server.js`
};
},

output: () => {
output: (): OutputOptions => {
return {
dir: `${dest}/server`,
format: 'cjs',
sourcemap: dev
sourcemap
};
}
},

serviceworker: {
input: () => {
input: (): InputOption => {
return `${src}/service-worker.js`;
},

output: () => {
output: (): OutputOptions => {
return {
file: `${dest}/service-worker.js`,
format: 'iife'
format: 'iife',
sourcemap
}
}
}
Expand Down

0 comments on commit c653eef

Please sign in to comment.