Skip to content
Snippets Groups Projects
Select Git revision
  • 8639d935ca7b227d4f2890fc9d010ab2103d3623
  • main default protected
  • register-logging-channel
  • expr-lang
  • ci-82
  • attr-events
  • locale-wip
  • custom-routes
  • v0.1.85
  • v0.1.84
  • v0.1.83
  • v0.1.82
  • v0.1.81
  • v0.1.80
  • v0.1.79
  • v0.1.78
  • v0.1.77
  • v0.1.76
  • v0.1.75
  • v0.1.74
  • v0.1.73
  • v0.1.72
  • v0.1.71
  • v0.1.70
  • v0.1.69
  • v0.1.68
  • v0.1.67
  • v0.1.65
28 results

AbstractDataProvider.php

Blame
  • rollup.config.js 2.10 KiB
    import glob from 'glob';
    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 del from 'rollup-plugin-delete';
    import {getPackagePath, getDistPath} from '../../rollup.utils.js';
    
    const pkg = require('./package.json');
    const build = (typeof process.env.BUILD !== 'undefined') ? process.env.BUILD : 'local';
    console.log("build: " + build);
    
    let nextcloudBaseURL = 'https://cloud.tugraz.at';
    let nextcloudFileURL = nextcloudBaseURL + '/apps/files/?dir=';
    
    export default (async () => {
        return {
            input: (build !== 'test') ? ['src/demo.js', 'src/dbp-file-source.js', 'src/dbp-file-sink.js'] : glob.sync('test/**/*.js'),
            output: {
                dir: 'dist',
                entryFileNames: '[name].js',
                chunkFileNames: 'shared/[name].[hash].[format].js',
                format: 'esm',
                sourcemap: true
            },
            onwarn: function (warning, warn) {
                // ignore chai warnings
                if (warning.code === 'CIRCULAR_DEPENDENCY') {
                    return;
                }
                warn(warning);
            },
            plugins: [
                del({
                    targets: 'dist/*'
                }),
                resolve(),
                commonjs(),
                json(),
                (build !== 'local' && build !== 'test') ? terser() : false,
                copy({
                    targets: [
                        {src: 'assets/index.html', dest: 'dist'},
                        {src: 'assets/favicon.ico', dest: 'dist'},
                        {src: await getPackagePath('@dbp-toolkit/common', 'assets/icons/*.svg'), dest: 'dist/' + await getDistPath('@dbp-toolkit/common', 'icons')},
                        {src: await getPackagePath('tabulator-tables', 'dist/css'), dest: 'dist/' + await getDistPath(pkg.name, 'tabulator-tables')},
                    ],
                }),
                (process.env.ROLLUP_WATCH === 'true') ? serve({contentBase: 'dist', host: '127.0.0.1', port: 8002}) : false
            ]
        };
    })();