Skip to content
Snippets Groups Projects
Select Git revision
  • e6d34fbd6cd313c218e2476070ce5e0b0f86414b
  • main default protected
  • renovate/lock-file-maintenance
  • demo protected
  • person-select-custom
  • dbp-translation-component
  • icon-set-mapping
  • port-i18next-parser
  • remove-sentry
  • favorites-and-recent-files
  • revert-6c632dc6
  • lit2
  • advertisement
  • wc-part
  • automagic
  • publish
  • wip-cleanup
  • demo-file-handling
18 results

dbp-clipboard.js

Blame
  • rollup.config.js 1.61 KiB
    import path from 'path';
    import resolve from 'rollup-plugin-node-resolve';
    import commonjs from 'rollup-plugin-commonjs';
    import copy from 'rollup-plugin-copy';
    import {terser} from "rollup-plugin-terser";
    import json from 'rollup-plugin-json';
    import serve from 'rollup-plugin-serve';
    import multiEntry from 'rollup-plugin-multi-entry';
    import consts from 'rollup-plugin-consts';
    import del from 'rollup-plugin-delete';
    
    const build = (typeof process.env.BUILD !== 'undefined') ? process.env.BUILD : 'local';
    console.log("build: " + build);
    
    export default {
        input: (build !== 'test') ? 'src/demo.js' : 'test/**/*.js',
        output: {
            file: 'dist/bundle.js',
            format: 'esm'
        },
        plugins: [
            del({
                targets: 'dist/*'
            }),
            multiEntry(),
            consts({
                environment: build,
            }),
            resolve({
                customResolveOptions: {
                    // ignore node_modules from vendored packages
                    moduleDirectory: path.join(process.cwd(), 'node_modules')
                }
            }),
            commonjs({
                include: 'node_modules/**'
            }),
            json(),
            (build !== 'local' && build !== 'test') ? terser() : false,
            copy({
                targets: [
                    {src: 'assets/index.html', dest: 'dist'},
                    {src: 'assets/favicon.ico', dest: 'dist'},
                    {src: 'node_modules/material-design-icons-svg/paths/*.json', dest: 'dist/local/vpu-common/icons'},
                ],
            }),
            (process.env.ROLLUP_WATCH === 'true') ? serve({contentBase: 'dist', host: '127.0.0.1', port: 8002}) : false
        ]
    };