Skip to content

Instantly share code, notes, and snippets.

@danangponorogo
Created November 22, 2020 09:26
Show Gist options
  • Save danangponorogo/77a172be58165cef20c421a587ff9a5d to your computer and use it in GitHub Desktop.
Save danangponorogo/77a172be58165cef20c421a587ff9a5d to your computer and use it in GitHub Desktop.
import alias from "@rollup/plugin-alias";
import path from "path";
import { createRollupConfigs } from './scripts/base.config.js'
import autoPreprocess from 'svelte-preprocess'
import postcssImport from 'postcss-import'
const production = !process.env.ROLLUP_WATCH;
export const config = {
staticDir: 'static',
distDir: 'dist',
buildDir: `dist/build`,
serve: !production,
production,
rollupWrapper: rollup => rollup,
svelteWrapper: svelte => {
svelte.preprocess = [
alias({
entries: [
{
find: "@",
replacement: path.resolve(__dirname, "src/")
}
]
}),
autoPreprocess({
postcss: { plugins: [postcssImport()] },
defaults: { style: 'postcss' }
})]
},
swWrapper: worker => worker,
}
const configs = createRollupConfigs(config)
export default configs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment