34 Star 166 Fork 58

Gitee 极速下载 / AR.js

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
此仓库是为了提升国内下载速度的镜像仓库,每日同步一次。 原始仓库: https://github.com/AR-js-org/AR.js
克隆/下载
webpack.config.js 4.08 KB
一键复制 编辑 原始数据 按行查看 历史
Nick Whitelegg 提交于 2022-03-25 20:00 . Merge latest dev; fix conflicts
var path = require('path');
module.exports = (env, argv) => {
let devtool = false;
if (argv.mode === 'development') {
devtool = 'inline-source-map';
}
console.log(`${argv.mode} build`);
const externals = {
aframe: {
commonjs: 'aframe',
commonjs2: 'aframe',
amd: 'aframe',
root: 'AFRAME' // indicates global variable
},
three: {
commonjs: 'three',
commonjs2: 'three',
amd: 'three',
root: 'THREE' // indicates global variable
}
};
const module = {
rules: [
{
test: /\.worker\.js$/,
use: {
loader: 'worker-loader',
options: {
inline: 'no-fallback'
}
}
}
]
};
return [{
name: 'aframe',
devtool,
entry: './aframe/src/index.js',
output: {
library: 'ARjs',
path: path.resolve(__dirname, 'aframe/build'),
filename: 'aframe-ar.js',
libraryTarget: 'umd',
globalObject: 'this'
},
resolve: {
alias: {
jsartoolkit: '@ar-js-org/artoolkit5-js',
threexArmarkercontrols$: path.resolve(__dirname, 'three.js/src/threex/arjs-markercontrols.js')
}
},
module,
externals
},
{
name: 'aframe-nft',
devtool,
entry: './aframe/src/index-nft.js',
output: {
library: 'ARjs',
path: path.resolve(__dirname, 'aframe/build'),
filename: 'aframe-ar-nft.js',
libraryTarget: 'umd',
globalObject: 'this'
},
resolve: {
alias: {
jsartoolkit: '@ar-js-org/artoolkit5-js',
threexArmarkercontrols$: path.resolve(__dirname, 'three.js/src/threex/arjs-markercontrols.js')
}
},
module,
externals
},
{
name: 'aframe-location-only',
devtool,
entry: './aframe/src/location-based/index.js',
output: {
library: 'ARjs',
path: path.resolve(__dirname, 'aframe/build'),
filename: 'aframe-ar-location-only.js',
libraryTarget: 'umd',
globalObject: 'this'
},
module,
externals
},
{
name: 'aframe-new-location-only',
devtool,
entry: './aframe/src/new-location-based/index.js',
output: {
library: 'ARjs',
path: path.resolve(__dirname, 'aframe/build'),
filename: 'aframe-ar-new-location-only.js',
libraryTarget: 'umd',
globalObject: 'this'
},
module,
externals
},
{
name: 'threex',
devtool,
entry: './three.js/src/index-threex.js',
output: {
library: 'THREEx',
path: path.resolve(__dirname, 'three.js/build'),
filename: 'ar-threex.js',
libraryTarget: 'umd',
globalObject: 'this'
},
resolve: {
alias: {
jsartoolkit: '@ar-js-org/artoolkit5-js',
threexArmarkercontrols$: path.resolve(__dirname, 'three.js/src/threex/arjs-markercontrols.js')
}
},
module,
externals: {
three: {
commonjs: 'three',
commonjs2: 'three',
amd: 'three',
root: 'THREE' // indicates global variable
}
}
},
{
name: 'threex-location-only',
devtool,
entry: './three.js/src/location-based/index.js',
output: {
library: 'THREEx',
path: path.resolve(__dirname, 'three.js/build'),
filename: 'ar-threex-location-only.js',
libraryTarget: 'umd',
globalObject: 'this'
},
module,
externals: {
three: {
commonjs: 'three',
commonjs2: 'three',
amd: 'three',
root: 'THREE' // indicates global variable
}
}
},
{
name: 'ar.js',
devtool,
entry: './three.js/src/index-arjs.js',
output: {
library: 'ARjs',
path: path.resolve(__dirname, 'three.js/build'),
filename: 'ar.js',
libraryTarget: 'umd',
globalObject: 'this'
},
resolve: {
alias: {
jsartoolkit: '@ar-js-org/artoolkit5-js',
threexArmarkercontrols$: path.resolve(__dirname, 'three.js/src/threex/arjs-markercontrols.js')
}
},
module,
externals: {
three: {
commonjs: 'three',
commonjs2: 'three',
amd: 'three',
root: 'THREE' // indicates global variable
}
}
}
];
};
JavaScript
1
https://gitee.com/mirrors/AR.js.git
git@gitee.com:mirrors/AR.js.git
mirrors
AR.js
AR.js
master

搜索帮助

53164aa7 5694891 3bd8fe86 5694891