syntaxseed / terminalfaker

Terminal Faker - A client-side Linux-like cli terminal simulation written in Javascript. Originally forked from AVGP/terminal.js.
MIT License
51 stars 20 forks source link

Minified bundle no longer accurate. #19

Open syntaxseed opened 5 years ago

syntaxseed commented 5 years ago

Minified bundle is no longer accurate. Need to configure a Babel process to minify.

Let's discuss - do we need to also transpile to ES5? What is browser support for ES6 these days?

syntaxseed commented 5 years ago

OMG, installed babel-cli and babel-minify npm packages and my node modules now has 168 directories and 1 reported vulnerability.

There must be a better way.

syntaxseed commented 5 years ago

Been trying to get this to work with webpack, but webpack encloses everything in a module scope and nothing is available from index.html. Anyone who can get the basics of combining and minifying the files in the src directory would be a big help.

deziev commented 5 years ago

Working on bundle and es6 migration right now. and faced same problem "nothing is available from index.html". Have some ideas

deziev commented 5 years ago

So, my idea was to create global variables and access them from bundled code. In that case index.html will look like this

    <!-- Global variables -->
    <script src="filesystem.js"></script>
    <script src="customCommands.js"></script>
    <!-- Minified build -->
    <script src="bundle.min.js"></script>
</body>
</html>

And the project structure:

image

js directory is bundled by webpack. Components like filesystem and custom commands to which user have access to change should be defined in src and have global scope

@syntaxseed dunno how to sync my fork. if I could create branches in this repo it would be lot easier)

EstherAF commented 5 years ago

@deziev to synk your fork you have to merge or rebase @syntaxseed master branch.

Here you have a more detailed tutorial: https://akrabat.com/the-beginners-guide-to-contributing-to-a-github-project/

EstherAF commented 5 years ago

You are talking about webpack but there is no webpack configuration file, or even package.json configuration file in master branch. I'd like to help, but I'm missing something here...

I have some ideas to get this bundled, transpiled and minified, but also available from the global context, but if there is some work already done in this direction, would be better than starting from scratch

syntaxseed commented 5 years ago

@EstherAF I tried to get it working with WebPack but failed miserably. 😥