添加 手势识别demo完成

This commit is contained in:
rucky
2021-12-24 19:18:22 +08:00
parent a8cca89108
commit 56107508f9
16 changed files with 939 additions and 228 deletions

View File

@@ -11,6 +11,7 @@ const path = require('path');
const CompressionPlugin = require('compression-webpack-plugin');
const vConsolePlugin = require("vconsole-webpack-plugin");
const TinyimgPlugin = require("tinyimg-webpack-plugin");
const CopyWebpackPlugin = require("copy-webpack-plugin");
function resolve(dir) {
return path.join(__dirname, dir);
@@ -83,7 +84,54 @@ module.exports = {
logged: true
})]
// 配置 copy plguins
let copyImg = [
new CopyWebpackPlugin([
// This is required so that yoha can load model files etc.
{ from: 'node_modules/@handtracking.io/yoha/', to: 'yoha/' },
// Required for github pages...
{ from: 'node_modules/coi-serviceworker/coi-serviceworker.min.js', to: './' },
])
]
config.plugins = [...config.plugins,
...pluginsDev,
...tinyimg,
...copyImg,
];
config.module.rules.push(
// ts加载
{
test: /\.tsx?$/,
use: [
{
loader: 'ts-loader',
options: {
transpileOnly: true,
appendTsSuffixTo: [/\.vue$/],
happyPackMode: true // 这个改为true
}
}
]
},
//wasm加载
{
test: /\.wasm$/i,
use: [
{
loader: 'file-loader', // 解决wasm加载问题
options: {
name: './static/wasm/[name].[ext]'
}
}
]
},
//模型加载
{
test: /\.(stl|obj|fbx|mtl|glb|gltf)?$/,
@@ -102,11 +150,6 @@ module.exports = {
}]
})
config.plugins = [...config.plugins,
...pluginsDev,
...tinyimg
];
// 配置gzip压缩
if (process.env.NODE_ENV === 'production') {
return {