Skip to content

Commit

Permalink
site: rollup resolve and onwarn improvements from sapper-template
Browse files Browse the repository at this point in the history
  • Loading branch information
Conduitry committed Nov 13, 2019
1 parent 7e2e23e commit feafc34
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions site/rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ const mode = process.env.NODE_ENV;
const dev = mode === 'development';
const legacy = !!process.env.SAPPER_LEGACY_BUILD;

const onwarn = (warning, onwarn) => (warning.code === 'CIRCULAR_DEPENDENCY' && /[/\\]@sapper[/\\]/.test(warning.message)) || onwarn(warning);
const dedupe = importee => importee === 'svelte' || importee.startsWith('svelte/');

export default {
client: {
input: config.client.input(),
Expand All @@ -28,7 +31,10 @@ export default {
hydratable: true,
emitCss: true
}),
resolve(),
resolve({
browser: true,
dedupe
}),
commonjs(),
json(),

Expand All @@ -53,6 +59,7 @@ export default {
module: true
})
],
onwarn
},

server: {
Expand All @@ -67,7 +74,9 @@ export default {
generate: 'ssr',
dev
}),
resolve(),
resolve({
dedupe
}),
commonjs(),
json()
],
Expand All @@ -78,6 +87,7 @@ export default {
require('module').builtinModules || Object.keys(process.binding('natives'))
)
],
onwarn
},

serviceworker: {
Expand Down

0 comments on commit feafc34

Please sign in to comment.