Skip to content
Snippets Groups Projects
Select Git revision
  • 78175819efb58ae4a4301ae4fde6765f8e294eb7
  • main default protected
  • demo protected
  • master
  • icon-set-mapping
  • production protected
  • revert-62666d1a
  • favorites-and-recent-files
  • lit2
  • wc-part
  • mark-downloaded-files
  • feature/annotpdf-test
  • fix-zip-upload
  • config-cleanup
  • wip
  • app-shell-update
16 results

dbp-pdf-annotation-view.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
        ]
    };