UNPKG

@pnext/three-loader

Version:

Potree loader for ThreeJS, converted and adapted to Typescript.

42 lines (39 loc) 898 B
const path = require('path'); const SizePlugin = require('size-plugin'); module.exports = { entry: './src/index.ts', output: { path: path.resolve(__dirname, 'build'), filename: 'potree.js', library: 'potree', libraryTarget: 'umd', umdNamedDefine: true, }, devtool: 'eval-cheap-source-map', stats: 'errors-only', resolve: { extensions: ['.ts', '.tsx', '.js'], }, externals: ['three'], module: { rules: [ { test: /\.worker\.js$/, loader: 'worker-loader', options: { inline: 'no-fallback' }, }, { test: /\.js$/, exclude: /node_modules/, loader: 'babel-loader', }, { test: /\.tsx?$/, loader: 'ts-loader', exclude: /node_modules/, }, { test: /\.(vs|fs|glsl|vert|frag)$/, loader: 'raw-loader' }, ], }, plugins: [new SizePlugin()], };