Skip to content

Commit

Permalink
prod runs
Browse files Browse the repository at this point in the history
  • Loading branch information
Paul McKellar committed Nov 19, 2022
1 parent 7cc2621 commit 995b58d
Show file tree
Hide file tree
Showing 2 changed files with 63 additions and 0 deletions.
1 change: 1 addition & 0 deletions prod/viewer.html

Large diffs are not rendered by default.

62 changes: 62 additions & 0 deletions webpack.oct.prod.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
const path = require('path');
const HtmlWebpackPlugin = require('html-webpack-plugin');
const HtmlInlineScriptPlugin = require('html-inline-script-webpack-plugin');
const TerserPlugin = require('terser-webpack-plugin');

module.exports = {
mode: 'production',
watch: false,
entry: {
seed: './src/seed.js',
modeldata: './src/modelsMin.js',
sdf: './src/octree/sdf.js',
buildmodel: './src/repo.js',
glslloader: './src/octree/glslloader.js',
oct: './src/octree/oct.js',
viewer: './src/octree/viewer.js',
},
optimization: {
minimize: true,
minimizer: [
new TerserPlugin({
test: /\.js(\?.*)?$/i,
terserOptions: {
mangle: true, // Note `mangle.properties` is `false` by default.
compress: {
drop_console: true,
},
},
}),
],
},
// devtool: 'inline-source-map',
module: {
rules: [
{
test: /\.glsl$/,
use: [
{
loader: 'webpack-glsl-loader',
},
],
},
],
},
plugins: [
new HtmlWebpackPlugin({
title: 'Tickle Beach',
template: 'src/octree/viewer.html',
inject: 'body',
filename: 'viewer.html',
}),
new HtmlInlineScriptPlugin(),
],
performance: {
hints: false,
}, // hides the "huge file" warnings which i assume won't be relevant
output: {
filename: '[name].js',
path: path.resolve(__dirname, 'prod'),
clean: false,
},
};

0 comments on commit 995b58d

Please sign in to comment.