How to use rollup-plugin-license - 8 common examples

To help you get started, we’ve selected a few rollup-plugin-license examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github mattrothenberg / vue-grid-styled / rollup.config.js View on Github external
if (opts.env) {
    config.plugins.push(
      replace({
        "process.env.NODE_ENV": JSON.stringify(opts.env)
      })
    );

    // minify on production targets
    if (opts.env === "production") {
      config.plugins.push(uglify({}, minify));
    }
  }

  // output a license to builds
  config.plugins.push(
    license({
      sourceMap: true,
      banner: {
        file: path.resolve("LICENSE.md")
      }
    })
  );

  Object.defineProperty(config, "_name", {
    enumerable: false,
    value: name
  });

  return config;
}
github jledentu / vue-finder / rollup.config.js View on Github external
if (opts.env) {
    config.plugins.push(
      replace({
        "process.env.NODE_ENV": JSON.stringify(opts.env)
      })
    );

    // minify on production targets
    if (opts.env === "production") {
      config.plugins.push(terser());
    }
  }

  // output a license to builds
  config.plugins.push(
    license({
      sourcemap: true,
      banner: {
        content: {
          file: path.resolve("LICENSE")
        }
      }
    })
  );

  Object.defineProperty(config, "_name", {
    enumerable: false,
    value: name
  });

  return config;
}
github shipshapecode / shepherd / rollup.config.js View on Github external
baseDir: 'demo',
        routes: {
          '/dist/css/shepherd.css': 'dist/css/shepherd.css',
          '/dist/js/shepherd.js': 'dist/js/shepherd.js',
          '/demo/js/prism.js': 'demo/js/prism.js',
          '/demo/js/welcome.js': 'demo/js/welcome.js',
          '/demo/css/prism.css': 'demo/css/prism.css',
          '/demo/css/welcome.css': 'demo/css/welcome.css',
          '/demo/sheep.svg': 'demo/sheep.svg'
        }
      }
    })
  );
}

plugins.push(license({ banner }));
plugins.push(filesize());
plugins.push(visualizer());

const rollupBuilds = [
  // Generate unminifed bundle
  {
    input: './src/js/shepherd.js',

    output: [
      {
        file: pkg.main,
        format: 'umd',
        name: 'Shepherd',
        sourcemap: true
      },
      {
github rollup / rollup / rollup.config.js View on Github external
export default command => {
	const commonJSBuild = {
		input: {
			'rollup.js': 'src/node-entry.ts',
			'bin/rollup': 'cli/index.ts'
		},
		onwarn,
		plugins: [
			...nodePlugins,
			addSheBang(),
			!command.configTest && license({ thirdParty: generateLicenseFile })
		],
		// acorn needs to be external as some plugins rely on a shared acorn instance
		external: ['acorn', 'assert', 'crypto', 'events', 'fs', 'module', 'path', 'util'],
		treeshake,
		output: {
			banner,
			chunkFileNames: 'shared/[name].js',
			dir: 'dist',
			entryFileNames: '[name]',
			externalLiveBindings: false,
			format: 'cjs',
			freeze: false,
			interop: false,
			sourcemap: true
		}
	};
github joe-sky / nornj / packages / nornj-react / rollup.config.js View on Github external
warnings: false
      })
    );
  }

  config.plugins.push(filesize());
} else {
  config = {
    input: './src/base.ts',
    output: { format: 'es' },
    plugins: [dts()]
  };
}

config.plugins.push(
  license({
    banner: `/*!
 * NornJ-React${withEx ? '-' + withEx : ''} v${require('../../package.json').version}
 * (c) 2016-2019 Joe_Sky
 * Released under the MIT License.
 */`
  })
);

export default config;
github GerkinDev / vuejs-datatable / rollup.config.js View on Github external
typescript({
			objectHashIgnoreUnknownHack: true,
			clean: true,//environment === 'production',
			include: _.compact( [
				"src/*.ts",
				"src/**/*.ts",
				environment === 'demo' ? "tutorials/.tmp/**/*.ts" : undefined,
				environment === 'demo' ? "tutorials/**/*.ts" : undefined,
			] ),
			tsconfigOverride,
		}),
		replace({
			'process.env.NODE_ENV': JSON.stringify( environment ),
		}),

		environment === 'production' ?  license( {
			banner: `${ pkg.name } v${ pkg.version }
License: ${ pkg.license }
Repository: ${ pkg.repository.url }
Generated on ${ moment().format( 'YYYY-MM-DD [at] HH:mm:ss' ) }.
By ${ allContributorsString }`,
		} ) : undefined,

		environment === 'production' ? terser({
			compress: {
				passes: 2,
				unsafe: true,
			}
		}) : undefined,

		environment === 'production' ? visualizer( { filename: `./stats/${ iife ? 'iife' : 'esm' }.html` } ) : undefined,
github WickyNilliams / headroom.js / rollup.config.js View on Github external
import license from "rollup-plugin-license";
import { uglify } from "rollup-plugin-uglify";
import filesize from "rollup-plugin-filesize";
import { eslint } from "rollup-plugin-eslint";

const input = "src/Headroom.js";

const output = {
  format: "umd",
  name: "Headroom"
};

const licensePlugin = license({
  banner: {
    commentStyle: "ignored",
    content: `<%= pkg.name %> v<%= pkg.version %> - <%= pkg.description %>
              Copyright (c) <%= moment().format('YYYY') %> <%= pkg.author %> - <%= pkg.homepage %>
              License: <%= pkg.license %>`
  }
});

const unminified = {
  input,
  output: {
    ...output,
    file: "dist/headroom.js"
  },
  plugins: [
    eslint(),
github Grsmto / simplebar / packages / simplebar / rollup.config.js View on Github external
if (Object.keys(pkg.dependencies).find(dep => id === dep) || id.match(/(core-js).+/)) {
        return true;
      }

      return false;
    },
    output: {
      file: pkg.module,
      format: 'es',
      sourcemap: true
    },
    plugins: [
      babel({
        exclude: ['/**/node_modules/**']
      }),
      license(licence)
    ]
  }
];

rollup-plugin-license

Rollup plugin to add license banner to the final bundle and output third party licenses

MIT
Latest version published 3 months ago

Package Health Score

78 / 100
Full package analysis

Popular rollup-plugin-license functions