Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const aliases = alias({
resolve: extensions.reduce((acc, ext) => [...acc, ext, `/index${ext}`], []),
'@': path.resolve(__dirname, 'src'),
});
const preprocess = sveltePreprocess({ postcss: true });
// eslint-disable-next-line no-shadow
const onwarn = (warning, onwarn) =>
(warning.code === 'CIRCULAR_DEPENDENCY' &&
warning.message.includes('/@sapper/')) ||
onwarn(warning);
export default {
client: {
input: config.client.input(),
output: config.client.output(),
plugins: [
aliases,
replace({
'process.browser': true,
'process.env.NODE_ENV': JSON.stringify(mode),
}),
svelte({
dev,
hydratable: true,
preprocess,
emitCss: true,
}),
resolve({ browser: true, extensions }),
commonjs(),
!dev && terser({ module: true }),
],
const extensions = ['.mjs', '.js', '.svelte', '.css'];
const aliases = alias({
resolve: extensions.reduce((acc, ext) => [...acc, ext, `/index${ext}`], []),
'@': path.resolve(__dirname, 'src'),
});
const preprocess = sveltePreprocess({ postcss: true });
// eslint-disable-next-line no-shadow
const onwarn = (warning, onwarn) =>
(warning.code === 'CIRCULAR_DEPENDENCY' &&
warning.message.includes('/@sapper/')) ||
onwarn(warning);
export default {
client: {
input: config.client.input(),
output: config.client.output(),
plugins: [
aliases,
replace({
'process.browser': true,
'process.env.NODE_ENV': JSON.stringify(mode),
}),
svelte({
dev,
hydratable: true,
preprocess,
emitCss: true,
}),
resolve({ browser: true, extensions }),
commonjs(),
!dev && terser({ module: true }),