diff --git a/demo.html b/demo.html index 5f2fef8..852e35a 100644 --- a/demo.html +++ b/demo.html @@ -1,11 +1,10 @@ - + - - + diff --git a/package.json b/package.json index 07bffe3..488dae2 100644 --- a/package.json +++ b/package.json @@ -21,7 +21,7 @@ "@hyperion-framework/types": "^1.0.0", "@hyperion-framework/vault": "^1.0.0", "@popmotion/popcorn": "^0.4.4", - "nanoid": "^3.1.9", + "nanoid": "^3.1.25", "normalize-wheel": "^1.0.1", "popmotion": "^8.7.6", "react": "^16.12.0", @@ -59,6 +59,7 @@ "@typescript-eslint/eslint-plugin": "^2.4.0", "@typescript-eslint/parser": "^2.4.0", "babel-loader": "^8.0.6", + "esbuild": "^0.12.23", "eslint": "^6.8.0", "eslint-plugin-babel": "^5.3.0", "eslint-plugin-flowtype": "^4.6.0", diff --git a/tools/build.js b/tools/build.js new file mode 100644 index 0000000..29cbd97 --- /dev/null +++ b/tools/build.js @@ -0,0 +1,38 @@ +const pkg = require('../package.json'); + +require('esbuild') + .build({ + // entryPoints: ['src/standalone.ts'], + entryPoints: ['src/index.ts'], + outfile: 'dist/esbuild.js', + bundle: true, + minify: false, + sourcemap: true, + format: 'esm', + target: ['chrome58', 'firefox57', 'safari11', 'edge18'], + globalName: 'Atlas', + define: { + 'process.env.VERSION': JSON.stringify(pkg.version), + 'process.env.NODE_ENV': '"production"', + }, + external: [ + // List of modules. + 'react', + 'typescript-memoize', + 'stats.js', + 'normalize-wheel', + 'object-assign', + 'scheduler', + 'react-reconciler', + 'debounce', + 'react-dom', + 'typesafe-actions', + 'nanoid', + '@atlas-viewer/dna', + '@popmotion/popcorn', + 'popmotion', + 'react-use-measure', + '@hyperion-framework/vault', + ], + }) + .catch(() => process.exit(1)); diff --git a/yarn.lock b/yarn.lock index 83b606d..ac284d9 100644 --- a/yarn.lock +++ b/yarn.lock @@ -8191,6 +8191,11 @@ es6-symbol@^3.1.1, es6-symbol@~3.1.3: d "^1.0.1" ext "^1.1.2" +esbuild@^0.12.23: + version "0.12.23" + resolved "https://registry.yarnpkg.com/esbuild/-/esbuild-0.12.23.tgz#fd40d70d3ec5e7893d8c5be655e3e38d096dd882" + integrity sha512-qvS4aKnmKikoWGscd5lVAzgobMovlH/JhaWitRiQ8xJx0x1Fym0pqVjMFs43Nvff8WpibeWm+fWoLK88T1U0Xw== + escape-goat@^2.0.0: version "2.1.1" resolved "https://registry.yarnpkg.com/escape-goat/-/escape-goat-2.1.1.tgz#1b2dc77003676c457ec760b2dc68edb648188675" @@ -13260,11 +13265,16 @@ nan@^2.12.1, nan@^2.13.2: resolved "https://registry.yarnpkg.com/nan/-/nan-2.14.1.tgz#d7be34dfa3105b91494c3147089315eff8874b01" integrity sha512-isWHgVjnFjh2x2yuJ/tj3JbwoHu3UC2dX5G/88Cm24yB6YopVgxvBObDY7n5xW6ExmFhJpSEQqFPvq9zaXc8Jw== -nanoid@^3.0.1, nanoid@^3.1.9: +nanoid@^3.0.1: version "3.1.9" resolved "https://registry.yarnpkg.com/nanoid/-/nanoid-3.1.9.tgz#1f148669c70bb2072dc5af0666e46edb6cd31fb2" integrity sha512-fFiXlFo4Wkuei3i6w9SQI6yuzGRTGi8Z2zZKZpUxv/bQlBi4jtbVPBSNFZHQA9PNjofWqtIa8p+pnsc0kgZrhQ== +nanoid@^3.1.25: + version "3.1.25" + resolved "https://registry.yarnpkg.com/nanoid/-/nanoid-3.1.25.tgz#09ca32747c0e543f0e1814b7d3793477f9c8e152" + integrity sha512-rdwtIXaXCLFAQbnfqDRnI6jaRHp9fTcYBjtFKE8eezcZ7LuLjhUaQGNeMXf1HmRoCH32CLz6XwX0TtxEOS/A3Q== + nanomatch@^1.2.9: version "1.2.13" resolved "https://registry.yarnpkg.com/nanomatch/-/nanomatch-1.2.13.tgz#b87a8aa4fc0de8fe6be88895b38983ff265bd119"