Skip to content

Commit

Permalink
Update rollup.config.mjs
Browse files Browse the repository at this point in the history
  • Loading branch information
MelleD committed Oct 1, 2023
1 parent a8006bf commit 945129d
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions rollup.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ import typescript from '@rollup/plugin-typescript';
import terser from '@rollup/plugin-terser';
import sveltePreprocess from "svelte-preprocess";


const dev = process.env.ROLLUP_WATCH;
const production = !dev;

const MAIN_COMPONENT_NAME = "ExpanderCard";
const MAIN_COMPONENT_REGEX = /ExpanderCard\.svelte$/;
Expand All @@ -22,6 +22,7 @@ export default (commandlineargs) => {
return ({
input: 'src/index.ts',
output: {
sourcemap: !production,
format: 'umd',
name: MAIN_COMPONENT_NAME,
file: `public/${FILE_NAME}`,
Expand All @@ -40,10 +41,12 @@ export default (commandlineargs) => {
svelte({
preprocess:
sveltePreprocess({
sourceMap: !production
}),
compilerOptions: {
customElement: true,
hydratable: true,
dev: !production
},
emitCss: true
}),
Expand All @@ -52,8 +55,11 @@ export default (commandlineargs) => {
dedupe: ['svelte']
}),
commonjs(),
typescript({ sourceMap: true , inlineSources: true}),
!dev && terser({ format: { comments: false } }),
typescript({
sourceMap: !production,
inlineSources: !production
}),
production && terser(),
],
watch: {
clearScreen: false,
Expand Down

0 comments on commit 945129d

Please sign in to comment.