Toggle navigation
Toggle navigation
This project
Loading...
Sign in
arcs
/
arcs.js
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
3
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Authored by
Jean-Yves Didier
2021-08-26 08:15:03 +0200
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
2f6efe3d5a198263261f43164c9a0997338de4b2
2f6efe3d
1 parent
36dfa3b4
multiple target for webpack
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
151 additions
and
104 deletions
build/arcs.min.js
webpack.config.js
build/arcs.min.js
View file @
2f6efe3
This diff is collapsed. Click to expand it.
webpack.config.js
View file @
2f6efe3
...
...
@@ -3,114 +3,161 @@ const jsdoc = require('jsdoc-webpack-plugin');
const
copy
=
require
(
'copy-webpack-plugin'
);
const
eslint
=
require
(
'eslint-webpack-plugin'
);
module
.
exports
=
{
experiments
:
{
outputModule
:
true
},
entry
:
{
'arcs'
:
{
import
:
'./src/exports.js'
,
module
.
exports
=
[
{
name
:
"core"
,
experiments
:
{
outputModule
:
true
},
entry
:
{
'arcs'
:
{
import
:
'./src/exports.js'
,
},
},
mode
:
'none'
,
output
:
{
filename
:
'[name].js'
,
path
:
path
.
resolve
(
__dirname
,
'build'
),
library
:
{
type
:
'module'
,
}
},
module
:
{
parser
:
{
javascript
:
{
commonjsMagicComments
:
true
}
}
},
plugins
:
[
new
eslint
({}),
new
copy
({
patterns
:
[
{
from
:
'src/arcs_browser.js'
,
to
:
'arcs_browser.js'
},
{
from
:
'src/arcs_node.mjs'
,
to
:
'arcs_node.mjs'
}
]
})
]
},
mode
:
'none'
,
output
:
{
filename
:
'[name].js'
,
path
:
path
.
resolve
(
__dirname
,
'build'
),
library
:
{
type
:
'module'
,
}
},
module
:
{
parser
:
{
javascript
:
{
commonjsMagicComments
:
true
{
name
:
"core-min"
,
experiments
:
{
outputModule
:
true
},
entry
:
{
'arcs'
:
{
import
:
'./src/exports.js'
,
},
},
mode
:
'production'
,
output
:
{
filename
:
'[name].min.js'
,
path
:
path
.
resolve
(
__dirname
,
'build'
),
library
:
{
type
:
'module'
,
}
},
module
:
{
parser
:
{
javascript
:
{
commonjsMagicComments
:
true
}
}
}
}
,
},
plugins
:
[
new
jsdoc
({
conf
:
'docs/engine.conf.json'
,
destination
:
'docs/engine'
,
template
:
'docs/arcs'
,
}),
new
jsdoc
({
conf
:
'docs/components.conf.json'
,
destination
:
'docs/components'
,
template
:
'docs/arcs'
,
}),
new
copy
({
patterns
:
[
{
from
:
'src/arcs_browser.js'
,
to
:
'arcs_browser.js'
},
{
from
:
'src/arcs_node.mjs'
,
to
:
'arcs_node.mjs'
},
{
from
:
'node_modules/tracking/build/tracking.js'
,
to
:
'../deps/tracking/tracking.js'
},
{
from
:
'node_modules/three/build/three.module.js'
,
to
:
'../deps/three.js/index.js'
},
{
from
:
'node_modules/three/examples/jsm/loaders/OBJLoader.js'
,
to
:
'../deps/objloader/index.js'
,
transform
:
function
(
content
,
path
)
{
return
Buffer
.
from
(
content
.
toString
().
replace
(
'../../../build/three.module.js'
,
'../three.js/index.js'
));
}
},
{
from
:
'node_modules/three/examples/jsm/loaders/MTLLoader.js'
,
to
:
'../deps/mtlloader/index.js'
,
transform
:
function
(
content
,
path
)
{
return
Buffer
.
from
(
content
.
toString
().
replace
(
'../../../build/three.module.js'
,
'../three.js/index.js'
));
}
},
{
from
:
'node_modules/three/examples/jsm/loaders/DDSLoader.js'
,
to
:
'../deps/ddsloader/index.js'
,
transform
:
function
(
content
,
path
)
{
return
Buffer
.
from
(
content
.
toString
().
replace
(
'../../../build/three.module.js'
,
'../three.js/index.js'
));
}
},
{
from
:
'node_modules/js-aruco/src/aruco.js'
,
to
:
'../deps/aruco/index.js'
,
transform
:
function
(
content
,
path
)
{
return
Buffer
.
from
(
content
.
toString
()
.
replace
(
"var CV = require('./cv');"
,
"import CV from '../cv/index.js';"
)
.
replace
(
"module.exports = AR;"
,
"export default AR;"
)
);
}
},
{
from
:
'node_modules/js-aruco/src/cv.js'
,
to
:
'../deps/cv/index.js'
,
transform
:
function
(
content
,
path
)
{
return
Buffer
.
from
(
content
.
toString
()
.
replace
(
"module.exports = CV;"
,
"export default CV;"
)
);
}
},
// TODO put here also files for dep directory.
// can also prepend content and replace strings using the transform property!
]
}),
new
eslint
({})
]
};
{
name
:
"doc"
,
mode
:
"development"
,
entry
:
{},
plugins
:
[
new
jsdoc
({
conf
:
'docs/engine.conf.json'
,
destination
:
'docs/engine'
,
template
:
'docs/arcs'
,
}),
new
jsdoc
({
conf
:
'docs/components.conf.json'
,
destination
:
'docs/components'
,
template
:
'docs/arcs'
,
}),
]
},
{
name
:
"deps"
,
mode
:
"production"
,
entry
:
{},
plugins
:
[
new
copy
({
patterns
:
[
{
from
:
'node_modules/tracking/build/tracking.js'
,
to
:
'../deps/tracking/tracking.js'
},
{
from
:
'node_modules/three/build/three.module.js'
,
to
:
'../deps/three.js/index.js'
},
{
from
:
'node_modules/three/examples/jsm/loaders/OBJLoader.js'
,
to
:
'../deps/objloader/index.js'
,
transform
:
function
(
content
,
path
)
{
return
Buffer
.
from
(
content
.
toString
().
replace
(
'../../../build/three.module.js'
,
'../three.js/index.js'
));
}
},
{
from
:
'node_modules/three/examples/jsm/loaders/MTLLoader.js'
,
to
:
'../deps/mtlloader/index.js'
,
transform
:
function
(
content
,
path
)
{
return
Buffer
.
from
(
content
.
toString
().
replace
(
'../../../build/three.module.js'
,
'../three.js/index.js'
));
}
},
{
from
:
'node_modules/three/examples/jsm/loaders/DDSLoader.js'
,
to
:
'../deps/ddsloader/index.js'
,
transform
:
function
(
content
,
path
)
{
return
Buffer
.
from
(
content
.
toString
().
replace
(
'../../../build/three.module.js'
,
'../three.js/index.js'
));
}
},
{
from
:
'node_modules/js-aruco/src/aruco.js'
,
to
:
'../deps/aruco/index.js'
,
transform
:
function
(
content
,
path
)
{
return
Buffer
.
from
(
content
.
toString
()
.
replace
(
"var CV = require('./cv');"
,
"import CV from '../cv/index.js';"
)
.
replace
(
"module.exports = AR;"
,
"export default AR;"
)
);
}
},
{
from
:
'node_modules/js-aruco/src/cv.js'
,
to
:
'../deps/cv/index.js'
,
transform
:
function
(
content
,
path
)
{
return
Buffer
.
from
(
content
.
toString
()
.
replace
(
"module.exports = CV;"
,
"export default CV;"
)
);
}
},
// TODO put here also files for dep directory.
// can also prepend content and replace strings using the transform property!
]
}),
]
}
];
...
...
Please
register
or
login
to post a comment