-
Hi, I'd like to make use of MDSVex for part of a bigger project I'm on that relies on svelte-preprocess for post-css and typescript support. Here is my svelte.config.js that I import in rollup: const preprocess = require('svelte-preprocess')
const production = !process.env.ROLLUP_WATCH;
// const { mdsvex } = require('mdsvex');
module.exports = {
preprocess: preprocess({
postcss:true,
// mdsvex(),
defaults: { markup: 'html', script: 'typescript', style: 'scss' },
})
} Relevant parts of my rollup config: import svelte from 'rollup-plugin-svelte';
import typescript from '@rollup/plugin-typescript';
import nodeResolve from '@rollup/plugin-node-resolve';
const { preprocess } = require('./svelte.config');
const production = !process.env.ROLLUP_WATCH;
export default {
input: 'src/main.ts',
output: {
sourcemap: true,
format: 'iife',
name: 'app',
file: 'public/build/bundle.js',
},
plugins: [
svelte({
dev: !production,
preprocess: [preprocess],
emitCss: true,
css: (inCSS) => {
inCSS.write('public/build/bundle.css');
},
}),
typescript({
sourceMap: !production,
checkJs: false,
}),
nodeResolve({
browser: true,
dedupe: ['svelte'],
})
]
} |
Beta Was this translation helpful? Give feedback.
Answered by
melMass
Sep 8, 2020
Replies: 1 comment
-
Ohhh.... I realise svelte.preprocess and svelte-preprocess are not the same, this works: ...
svelte({
...
preprocess: [mdsvex(), preprocess],
...
})
} |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
pngwn
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Ohhh.... I realise svelte.preprocess and svelte-preprocess are not the same, this works: