Skip to content

Commit

Permalink
Build tensorspace.dev.esm.js for DEV purpose
Browse files Browse the repository at this point in the history
  • Loading branch information
BoTime committed Feb 7, 2019
1 parent 6c3c1e7 commit a6d2675
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 3 deletions.
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@
"mocha": "^4.1.0",
"puppeteer": "^1.11.0",
"rollup": "^0.66.0",
"rollup-plugin-commonjs": "^9.2.0",
"rollup-plugin-node-resolve": "^4.0.0",
"rollup-plugin-terser": "^4.0.1",
"terser": "^3.14.1",
"yalc": "^1.0.0-pre.27"
Expand Down
32 changes: 29 additions & 3 deletions rollup.default.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
*/

import { terser } from 'rollup-plugin-terser';
import commonjs from 'rollup-plugin-commonjs';
import nodeResolve from 'rollup-plugin-node-resolve';

const terserOptions = {

Expand All @@ -18,8 +20,12 @@ const terserOptions = {

const defaultConfig = ( outputDir, createSourceMap = true ) => {

let devExternal = [ 'three', '@tweenjs/tween.js', '@tensorflow/tfjs' ];
let devInput = 'src/tensorspace.dev.js';

let external = [ 'three', '@tweenjs/tween.js', '@tensorflow/tfjs', 'three-trackballcontrols', 'stats-js' ];
let input = 'src/tensorspace.js';

let globals = {
'three': 'THREE',
'@tweenjs/tween.js': 'TWEEN',
Expand Down Expand Up @@ -67,13 +73,33 @@ const defaultConfig = ( outputDir, createSourceMap = true ) => {
file: `${outputDir}/tensorspace.cjs.js`,
name: moduleName

}, {
} ]

},
{

external: devExternal,
input: devInput,
plugins: [

nodeResolve({
jsnext: true,
main: true,
browser: true,
}),

commonjs(),

],
output: {

// Build for dev
format: 'esm',
file: `${outputDir}/tensorspace.esm.js`,
file: `${outputDir}/tensorspace.dev.esm.js`,
name: moduleName

} ]
}

}

];
Expand Down

0 comments on commit a6d2675

Please sign in to comment.