Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
},
server: {
input: config.server.input(),
output: config.server.output(),
plugins: [
replace({
'process.browser': false,
'process.env.NODE_ENV': JSON.stringify(mode),
}),
svelte({
generate: 'ssr',
dev,
// whatever file extension you want to use has to go here as well
extensions: ['.svelte', '.svexy', '.svx', '.md'], // here actually
preprocess: mdsvex({
// extension: '.md', // the default is '.svexy', if you lack taste, you might want to change it
// layout: path.join(__dirname, './DefaultLayout.svelte'), // this needs to be an absolute path
// parser: md => md.use(SomePlugin), // you can add markdown-it plugins if the feeling takes you
// // you can add markdown-it options here, html is always true
// markdownOptions: {
// typographer: true,
// linkify: true,
// highlight: (str, lang) => whatever(str, lang), // this should be a real function if you want to highlight
// },
}),
}),
resolve({
dedupe,
}),
commonjs(),
],
input: ['src/**/*.md', 'src/**/*.html'],
output: {
format: 'cjs',
dir: 'dist'
},
plugins: [
svelte({
// enable run-time checks when not in production
dev: !production,
// we'll extract any component CSS out into
// a separate file — better for performance
css: css => {
css.write('public/bundle.css');
},
extensions: ['.svelte', '.md', '.html'],
preprocess: mdsvex({
extension: '.md'
}),
generate: 'ssr'
}),
// If you have external dependencies installed from
// npm, you'll most likely need these plugins. In
// some cases you'll need additional configuration —
// consult the documentation for details:
// https://github.com/rollup/rollup-plugin-commonjs
resolve({ browser: true }),
commonjs(),
// Watch the `public` directory and refresh the
// browser on changes when not in production