Git Product home page Git Product logo

dont-copy-paste-this-frontend-template's Introduction

dont-copy-paste-this-frontend-template's People

Contributors

kimmobrunfeldt avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

dont-copy-paste-this-frontend-template's Issues

How to use libraries which are not in NPM or don't support CommonJS module import?

You may be tempted to use a shimming plugin for browserify to ideally include these libraries to your build tool chain. I would advice to forget all that hassle and just add the external module as a script tag before bundle.js:

<script src="http://code.highcharts.com/highcharts.js"></script>

and assume that Highcharts is a globally available variable similar to window and document variables. It's not ideal, and causes browser to do an extra request but it will save you from the never ending hassle of supporting various module import standards.

You can try to setup shim plugins, I'm not sure how they work nowadays but you've been warned.

Comment on Windows compatability

As of Windows 10 Anniversary update we now have Bash on Ubuntu on Windows. It's not perfect but if Windows devs use it the portability issues mostly go away. Hoorah!!!

Prior to this I used the git for windows bash shelland started each npm script that requires portability with bash -c ""; however escaping quotes can become a real mess.

I noticed you scripts are not strictly portable as you set env vars at the start if the line. There is a npm package you can use but I think we can forget such hacks that now as mention above.

Why is my bundle.js multiple megabytes large?

Don't worry, it will shrink a lot in production build.

As an example, let's see how big a bundle.js this project has:

  • The development version of bundle.js is 1.8M
  • Minified production version of bundle.js is 278K
  • Minified and GZipped version of bundle.js is 65K, which is probably smaller then any picture in your page.

Even if the initial development version would be >4M in size, it's should be OK. E.g React is quite a big library and it increases the size a lot. If you need to analyze how you could reduce the size, disc is a useful tool to visualize the dependencies' sizes: https://github.com/hughsk/disc

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.