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

Make sure tf-core.(min).js bundle has the @license header #1063

Merged
merged 1 commit into from
May 28, 2018
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
2 changes: 2 additions & 0 deletions .npmignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
.vscode/
.rpt2_cache/
demos/
integration_tests/
docs/
scripts/
src/
Expand Down
19 changes: 18 additions & 1 deletion rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,23 @@ import typescript from 'rollup-plugin-typescript2';
import commonjs from 'rollup-plugin-commonjs';
import resolve from 'rollup-plugin-node-resolve';

const PREAMBLE = `/**
* @license
* Copyright ${(new Date).getFullYear()} Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/`;

export default {
input: 'src/index.ts',
plugins: [
Expand All @@ -35,7 +52,7 @@ export default {
],
output: {
extend: true,
banner: `// @tensorflow/tfjs-core Copyright ${(new Date).getFullYear()} Google`,
banner: PREAMBLE,
file: 'dist/tf-core.js',
format: 'umd',
name: 'tf',
Expand Down
2 changes: 1 addition & 1 deletion scripts/build-npm.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ yarn

yarn build
rollup -c
uglifyjs dist/tf-core.js -c -m -o dist/tf-core.min.js
uglifyjs dist/tf-core.js --comments -c -m -o dist/tf-core.min.js

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