question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

I have a babylon project with a webpack config which is very similar to yours but when i’m compiling files to dist, my babylonBundle.js is strangely heavier than it have to be. (4.9 Mo). Do you have an idea of this ?

webpack.common.js :

const path = require('path');
const fs = require('fs');
const HtmlWebpackPlugin = require('html-webpack-plugin');
const CopyPlugin = require('copy-webpack-plugin');
const {
    CleanWebpackPlugin
} = require('clean-webpack-plugin');

// App directory
const appDirectory = fs.realpathSync(process.cwd());

module.exports = {
    entry: {
        app: path.resolve(appDirectory, "src/index.ts"),
    },
    output: {
        filename: 'js/babylonBundle.js',
    },
    resolve: {
        extensions: ['.ts', '.js']
    },
    module: {
        rules: [{
                test: /\.(js|mjs|jsx|ts|tsx)$/,
                loader: 'source-map-loader',
                enforce: 'pre',
            },
            {
                test: /\.tsx?$/,
                loader: 'ts-loader'
            },
            {
                test: /\.(png|jpg|gif|env|glb|stl|obj|mtl)$/i,
                use: [{
                    loader: 'url-loader',
                }, ],
            },
        ]
    },
    plugins: [
        new CleanWebpackPlugin(),
        new HtmlWebpackPlugin({
            inject: true,
            template: path.resolve(appDirectory, "public/index.html"),
        }),
        new CopyPlugin({
            patterns: [
                { from: 'assets', to: 'assets' },
            ],
        }),
    ],
    // Just for ammo
    node: {
        fs: 'empty'
    }
}

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
RaananWcommented, Sep 28, 2020

Exactly like that 😃

1reaction
alamboleycommented, Sep 28, 2020

Thanks for the quick answer! Ok so like this :

import { Engine } from "@babylonjs/core/Engines/engine";
import { Scene } from "@babylonjs/core/scene";
import { ArcRotateCamera } from "@babylonjs/core/Cameras/arcRotateCamera";
Read more comments on GitHub >

github_iconTop Results From Across the Web

Understanding file sizes | GreenNet
Every file on a computer uses a certain amount of resources when sent over the internet or stored. Keeping mind of your kilobytes...
Read more >
word request - How to say a file is very big?
1. There is nothing wrong with very big. A common phrase for your case would be "The file was very big." or "The...
Read more >
My documents are too large to upload. How do I reduce the ...
First, make sure you know the file size limit for the online application you use. Depending on what you're applying for, the limit...
Read more >
File sizes | AP CSP (article) | Khan Academy
Once a file size is bigger than 1024 1024 10241024 kilobytes (or 1000 1000 10001000, depending which computer you ask), we can start...
Read more >
File Size Guidelines - University of St. Thomas
of restrictions imposed on the size of files uploaded into Blackboard. ... As a rule, files over 50 MB are considered “large” files...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found