Skip to content

Gen copyright on dist files #1815

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 17, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 0 additions & 6 deletions resources/COPYRIGHT

This file was deleted.

6 changes: 6 additions & 0 deletions resources/copyright.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import fs from 'fs';

const copyright = fs.readFileSync('./LICENSE', 'utf-8');
const lines = copyright.trim().split('\n');

export default `/**\n${lines.map((line) => ` * ${line}`).join('\n')}\n */`;
3 changes: 1 addition & 2 deletions resources/rollup-config-es.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
import fs from 'fs';
import path from 'path';
import buble from 'rollup-plugin-buble';
import commonjs from 'rollup-plugin-commonjs';
import json from 'rollup-plugin-json';
import stripBanner from 'rollup-plugin-strip-banner';

const copyright = fs.readFileSync(path.join('resources', 'COPYRIGHT'), 'utf-8');
import copyright from './copyright';

const SRC_DIR = path.resolve('src');
const DIST_DIR = path.resolve('dist');
Expand Down
2 changes: 1 addition & 1 deletion resources/rollup-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import json from 'rollup-plugin-json';
import saveLicense from 'uglify-save-license';
import stripBanner from 'rollup-plugin-strip-banner';

const copyright = fs.readFileSync(path.join('resources', 'COPYRIGHT'), 'utf-8');
import copyright from './copyright';

const SRC_DIR = path.resolve('src');
const DIST_DIR = path.resolve('dist');
Expand Down