mirror of
https://github.com/niklasvh/html2canvas.git
synced 2023-08-10 21:13:10 +03:00
Add license info to builds (Fix #1126)
This commit is contained in:
parent
8da77eb689
commit
f7f445c71e
1
flow-typed/myLibDef.js
vendored
1
flow-typed/myLibDef.js
vendored
@ -1 +1,2 @@
|
|||||||
declare var __DEV__: boolean;
|
declare var __DEV__: boolean;
|
||||||
|
declare var __VERSION__: string;
|
||||||
|
@ -24,6 +24,10 @@ export type Options = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const html2canvas = (element: HTMLElement, config: Options): Promise<HTMLCanvasElement> => {
|
const html2canvas = (element: HTMLElement, config: Options): Promise<HTMLCanvasElement> => {
|
||||||
|
if (typeof console === 'object' && typeof console.log === 'function') {
|
||||||
|
console.log(`html2canvas ${__VERSION__}`);
|
||||||
|
}
|
||||||
|
|
||||||
const logger = new Logger();
|
const logger = new Logger();
|
||||||
|
|
||||||
const ownerDocument = element.ownerDocument;
|
const ownerDocument = element.ownerDocument;
|
||||||
|
@ -1,4 +1,13 @@
|
|||||||
const webpack = require('webpack');
|
const webpack = require('webpack');
|
||||||
|
const fs = require('fs');
|
||||||
|
const path = require('path');
|
||||||
|
|
||||||
|
const pkg = JSON.parse(fs.readFileSync(path.resolve(__dirname, '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`;
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
entry: './src/index.js',
|
entry: './src/index.js',
|
||||||
@ -16,7 +25,9 @@ module.exports = {
|
|||||||
},
|
},
|
||||||
plugins: [
|
plugins: [
|
||||||
new webpack.DefinePlugin({
|
new webpack.DefinePlugin({
|
||||||
'__DEV__': true
|
'__DEV__': true,
|
||||||
})
|
'__VERSION__': JSON.stringify(pkg.version)
|
||||||
|
}),
|
||||||
|
new webpack.BannerPlugin(banner)
|
||||||
]
|
]
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user