File tree Expand file tree Collapse file tree 3 files changed +27
-1
lines changed Expand file tree Collapse file tree 3 files changed +27
-1
lines changed Original file line number Diff line number Diff line change 4
4
"description" : " Quickstart project for DeepAR Web." ,
5
5
"main" : " index.js" ,
6
6
"scripts" : {
7
- "build" : " rm -rf dist && webpack --config webpack.config.js --mode production && cp -r public/* dist && cp -r node_modules/deepar" ,
7
+ "build" : " rm -rf dist && webpack --config webpack.config.js --mode production && cp -r public/* dist && cp -r node_modules/deepar dist/deepar-resources " ,
8
8
"dev" : " webpack serve --mode development --open --port 8888"
9
9
},
10
10
"author" : " " ,
Original file line number Diff line number Diff line change @@ -45,6 +45,10 @@ console.log("Deepar version: " + deepar.version);
45
45
licenseKey : "your_license_key_goes_here" ,
46
46
canvas,
47
47
effect : effectList [ 0 ] ,
48
+ // Removing the rootPath option will make DeepAR load the resources from the JSdelivr CDN,
49
+ // which is fine for development but is not recommended for production since it's not optimized for performance and can be unstable.
50
+ // More info here: https://docs.deepar.ai/deepar-sdk/deep-ar-sdk-for-web/download-optimizations#custom-deployment-of-deepar-web-resources
51
+ rootPath : "./deepar-resources" ,
48
52
} ) ;
49
53
} catch ( error ) {
50
54
console . error ( error ) ;
Original file line number Diff line number Diff line change @@ -8,6 +8,28 @@ module.exports = {
8
8
clean : true ,
9
9
} ,
10
10
target : "web" ,
11
+ module : {
12
+ rules : [
13
+ {
14
+ test : / \. ( w a s m ) | ( b i n ) | ( o b j ) $ / i,
15
+ include : [
16
+ path . resolve ( __dirname , 'node_modules/deepar/' ) ,
17
+ ] ,
18
+ type : 'asset/resource' ,
19
+ } ,
20
+ {
21
+ include : [
22
+ path . resolve ( __dirname , 'effects/' ) ,
23
+ ] ,
24
+ type : 'asset/resource' ,
25
+ } ,
26
+ ] ,
27
+ } ,
28
+ resolve : {
29
+ alias : {
30
+ '@effects' : path . resolve ( __dirname , 'effects/' ) ,
31
+ } ,
32
+ } ,
11
33
performance : {
12
34
maxEntrypointSize : 1000000 ,
13
35
maxAssetSize : 10000000 ,
You can’t perform that action at this time.
0 commit comments