mirror of
https://github.com/kevin-DL/sapper-template.git
synced 2026-01-14 03:04:40 +00:00
rollup: suppress @sapper circular dependency warnings (#145)
This commit is contained in:
@@ -11,6 +11,8 @@ 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' && warning.message.includes('/@sapper/')) || onwarn(warning);
|
||||
|
||||
export default {
|
||||
client: {
|
||||
input: config.client.input(),
|
||||
@@ -49,6 +51,8 @@ export default {
|
||||
module: true
|
||||
})
|
||||
],
|
||||
|
||||
onwarn,
|
||||
},
|
||||
|
||||
server: {
|
||||
@@ -69,6 +73,8 @@ export default {
|
||||
external: Object.keys(pkg.dependencies).concat(
|
||||
require('module').builtinModules || Object.keys(process.binding('natives'))
|
||||
),
|
||||
|
||||
onwarn,
|
||||
},
|
||||
|
||||
serviceworker: {
|
||||
@@ -82,6 +88,8 @@ export default {
|
||||
}),
|
||||
commonjs(),
|
||||
!dev && terser()
|
||||
]
|
||||
],
|
||||
|
||||
onwarn,
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user