Skip to content
This repository was archived by the owner on Aug 15, 2019. It is now read-only.

Commit 52701e9

Browse files
authored
Make sure tf-core.(min).js bundle has the @license header (#1063)
1 parent fd49f54 commit 52701e9

File tree

3 files changed

+21
-2
lines changed

3 files changed

+21
-2
lines changed

.npmignore

+2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
.vscode/
2+
.rpt2_cache/
23
demos/
4+
integration_tests/
35
docs/
46
scripts/
57
src/

rollup.config.js

+18-1
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,23 @@ import typescript from 'rollup-plugin-typescript2';
2020
import commonjs from 'rollup-plugin-commonjs';
2121
import resolve from 'rollup-plugin-node-resolve';
2222

23+
const PREAMBLE = `/**
24+
* @license
25+
* Copyright ${(new Date).getFullYear()} Google LLC. All Rights Reserved.
26+
* Licensed under the Apache License, Version 2.0 (the "License");
27+
* you may not use this file except in compliance with the License.
28+
* You may obtain a copy of the License at
29+
*
30+
* http://www.apache.org/licenses/LICENSE-2.0
31+
*
32+
* Unless required by applicable law or agreed to in writing, software
33+
* distributed under the License is distributed on an "AS IS" BASIS,
34+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
35+
* See the License for the specific language governing permissions and
36+
* limitations under the License.
37+
* =============================================================================
38+
*/`;
39+
2340
export default {
2441
input: 'src/index.ts',
2542
plugins: [
@@ -35,7 +52,7 @@ export default {
3552
],
3653
output: {
3754
extend: true,
38-
banner: `// @tensorflow/tfjs-core Copyright ${(new Date).getFullYear()} Google`,
55+
banner: PREAMBLE,
3956
file: 'dist/tf-core.js',
4057
format: 'umd',
4158
name: 'tf',

scripts/build-npm.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ yarn
2121

2222
yarn build
2323
rollup -c
24-
uglifyjs dist/tf-core.js -c -m -o dist/tf-core.min.js
24+
uglifyjs dist/tf-core.js --comments -c -m -o dist/tf-core.min.js
2525

2626
echo "Stored standalone library at dist/tf-core(.min).js"
2727
npm pack

0 commit comments

Comments
 (0)