|
@@ -1,43 +1,51 @@
|
|
|
const fs = require('fs')
|
|
|
const PATH = `./.laser-lib-path`
|
|
|
-const dir = fs.existsSync(PATH)
|
|
|
- ? fs.readFileSync(PATH).toString()
|
|
|
- : `build`
|
|
|
+const buildPaths = [
|
|
|
+ `build`,
|
|
|
+ ...fs.existsSync(PATH) ? [fs.readFileSync(PATH).toString()] : []
|
|
|
+]
|
|
|
|
|
|
+const builds = []
|
|
|
|
|
|
-export default [
|
|
|
- {
|
|
|
- input: 'src/Potree.js',
|
|
|
- treeshake: false,
|
|
|
- output: {
|
|
|
- file: `${dir}/potree/potree.js`,
|
|
|
- format: 'umd',
|
|
|
- name: 'Potree',
|
|
|
- sourcemap: true,
|
|
|
- }
|
|
|
- }, {
|
|
|
- input: 'src/workers/BinaryDecoderWorker.js',
|
|
|
- output: {
|
|
|
- file: `${dir}/potree/workers/BinaryDecoderWorker.js`,
|
|
|
- format: 'es',
|
|
|
- name: 'Potree',
|
|
|
- sourcemap: false
|
|
|
- }
|
|
|
- },{
|
|
|
- input: 'src/modules/loader/2.0/DecoderWorker.js',
|
|
|
- output: {
|
|
|
- file: `${dir}/potree/workers/2.0/DecoderWorker.js`,
|
|
|
- format: 'es',
|
|
|
- name: 'Potree',
|
|
|
- sourcemap: false
|
|
|
- }
|
|
|
- },{
|
|
|
- input: 'src/modules/loader/2.0/DecoderWorker_brotli.js',
|
|
|
- output: {
|
|
|
- file: `${dir}/potree/workers/2.0/DecoderWorker_brotli.js`,
|
|
|
- format: 'es',
|
|
|
- name: 'Potree',
|
|
|
- sourcemap: false
|
|
|
- }
|
|
|
- }
|
|
|
-]
|
|
|
+for (const dir of buildPaths) {
|
|
|
+ builds.push(
|
|
|
+ ...[
|
|
|
+ {
|
|
|
+ input: 'src/Potree.js',
|
|
|
+ treeshake: false,
|
|
|
+ output: {
|
|
|
+ file: `${dir}/potree/potree.js`,
|
|
|
+ format: 'umd',
|
|
|
+ name: 'Potree',
|
|
|
+ sourcemap: true,
|
|
|
+ }
|
|
|
+ }, {
|
|
|
+ input: 'src/workers/BinaryDecoderWorker.js',
|
|
|
+ output: {
|
|
|
+ file: `${dir}/potree/workers/BinaryDecoderWorker.js`,
|
|
|
+ format: 'es',
|
|
|
+ name: 'Potree',
|
|
|
+ sourcemap: false
|
|
|
+ }
|
|
|
+ },{
|
|
|
+ input: 'src/modules/loader/2.0/DecoderWorker.js',
|
|
|
+ output: {
|
|
|
+ file: `${dir}/potree/workers/2.0/DecoderWorker.js`,
|
|
|
+ format: 'es',
|
|
|
+ name: 'Potree',
|
|
|
+ sourcemap: false
|
|
|
+ }
|
|
|
+ },{
|
|
|
+ input: 'src/modules/loader/2.0/DecoderWorker_brotli.js',
|
|
|
+ output: {
|
|
|
+ file: `${dir}/potree/workers/2.0/DecoderWorker_brotli.js`,
|
|
|
+ format: 'es',
|
|
|
+ name: 'Potree',
|
|
|
+ sourcemap: false
|
|
|
+ }
|
|
|
+ }
|
|
|
+ ]
|
|
|
+ )
|
|
|
+}
|
|
|
+
|
|
|
+export default builds
|