html2canvas/tests/rollup.config.ts
Niklas von Hertzen 34b06d6365
fix: correctly respect logging option (#2013)
* test: update to using jest for unit tests

* remove mocha types

* revert to using mocha for testrunner.ts

* add logger unit testing

* fix reftest previewer scaling

* fix LoggerOptions to interface

* fix linting
2019-09-25 03:37:59 -07:00

53 lines
1.7 KiB
TypeScript

import nodeResolve from 'rollup-plugin-node-resolve';
import commonjs from 'rollup-plugin-commonjs';
import sourceMaps from 'rollup-plugin-sourcemaps';
import typescript from 'rollup-plugin-typescript2';
import json from 'rollup-plugin-json';
import {resolve} from 'path';
const pkg = require('../package.json');
const banner = `/*
* ${pkg.title} ${pkg.version} <${pkg.homepage}>
* Copyright (c) ${new Date().getFullYear()} ${pkg.author.name} <${pkg.author.url}>
* Released under ${pkg.license} License
*/`;
export default {
input: `tests/testrunner.ts`,
output: [
{
file: resolve(__dirname, '../build/testrunner.js'),
name: 'testrunner',
format: 'iife',
banner,
sourcemap: true
}
],
external: [],
watch: {
include: 'tests/**'
},
plugins: [
// Allow node_modules resolution, so you can use 'external' to control
// which external modules to include in the bundle
// https://github.com/rollup/rollup-plugin-node-resolve#usage
nodeResolve(),
// Allow json resolution
json(),
// Compile TypeScript files
typescript({useTsconfigDeclarationDir: true, tsconfig: resolve(__dirname, 'tsconfig.json')}),
// Allow bundling cjs modules (unlike webpack, rollup doesn't understand cjs)
commonjs({
include: 'node_modules/**',
namedModules: {
'node_modules/platform/platform.js': ['name', 'version'],
'node_modules/es6-promise/dist/es6-promise.js': ['Promise']
}
}),
// Resolve source maps to the original source
sourceMaps()
]
};