import svelte from 'rollup-plugin-svelte'; import commonjs from '@rollup/plugin-commonjs'; import resolve from '@rollup/plugin-node-resolve'; import css from 'rollup-plugin-css-only'; import terser from '@rollup/plugin-terser'; // const production = !process.env.ROLLUP_WATCH; const production = false; // Keep runtime checks for the moment. // Note: ui/lite/Settings.svelte belongs to the base plugin (not present in this Pro-only repo). // The base plugin's compiled output (assets/js/settings.js) is committed directly. // This config only builds the Pro-specific entry point. const sharedPlugins = [ svelte( { compilerOptions: { // 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( { output: 'settings.css' } ), // 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/plugins/tree/master/packages/commonjs resolve( { browser: true, dedupe: ['svelte'] } ), commonjs() ]; export default [ // Unminified build (loaded when SCRIPT_DEBUG = true) { input: 'ui/pro/Settings.svelte', output: { sourcemap: true, format: 'umd', name: 'AS3CFPro_Settings', file: 'assets/js/pro/settings.js' }, plugins: sharedPlugins, watch: { clearScreen: false } }, // Minified build (loaded when SCRIPT_DEBUG = false, i.e. production) { input: 'ui/pro/Settings.svelte', output: { sourcemap: true, format: 'umd', name: 'AS3CFPro_Settings', file: 'assets/js/pro/settings.min.js' }, plugins: [ ...sharedPlugins, terser() ], watch: { clearScreen: false } } ];