npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

generator-gl-ionic-webpack-typescript-seed

v0.0.3

Published

All the things needed to make an awesome Ionic App built with Webpack and Typescript

Downloads

5

Readme

generator-gl-ionic-webpack-typescript-seed

All the things needed to make an awesome Ionic App built with Webpack and Typescript.

Why another generator? And Why Ionic 1?

One year ago, Ionic 2 and Angular 2 were really promising but still in Beta, Webpack was starting to win over Gulp and Typescript was in the Hipster phase. In this context, we ha to make clean, reusable, production ready hybrid apps. So to avoid all the "it's still in Beta" problems, we decided to go with Ionic 1 and Angular 1, but went for Webpack and Typescript to have a cleaner and more reusable code.

Why this generator?

Because it does exactly what we wanted : fast developpment AND production ready apps. And it took a while to get to this point with these new technologies.

Fast development

  • A fastcss Webpack configuration: At the time we made this conf, the css and sass processors were really slow. So that a simple change in the scss would make a full recompilation of the sass code (more than 1 second) and a full reload of the page. So, only in dev mode, we use gulp to handle the generated css. Result: the compilation is instant and only the css file is reloaded => BLAZING FAST.
  • Sass and Typescript sourcemaps: In dev mode ("npm run serve"), Webpack will generate the sourcemaps of the sass and Typescript files to help you debug your application.
  • App already in Typescript: It's kinda hard to get good articles explaining how to write Angular1 apps in Typescript. So with this seed, you already have a good example of how to do so.

Production ready

  • Minification safe: No need to do annotations on Angular to avoid problems at minification. ng-annotate does it all for you.
  • Autoprefix new css rules: No need to prefix new css rules like "-webkit-", autoprefixer does it for you.
  • Easily configure environments: Between the dev app and the production app, ore even the preproduction app, some variables will change (Google Analytics id, APi endpoints etc...). We use https://github.com/geeklearningio/gl-angular-configuration to do that. There is only one js file at the root of www containing all these variables which are loaded before your angular app. So you can get them even at the Angular config stage.

What could be better

  • Webpack 2.0: We don't really have the time right now to migrate to Webpack 2.0. If you're interested in it, PR are more than welcome.
  • Typings: So we updated to Typescript 2.0, but we're still using Typings to get Typescript typings. We have some weird errors with the new @typings system using npm and don't really have time to look into it. Motivated? PR are welcome!

How to use

Installation

CLIs

We need some CLis installed as global packages :

  • Yeoman: To run this generator.
  • Cordova: To build your Cordova app.
  • Typings: To manage Typescript typings. For more information: https://github.com/typings/typings
npm install -g yo cordova typings

Run the generator

Install this generator using npm:

npm install generator-gl-ionic-webpack-typescript-seed

Run it using Yeoman:

yo gl-ionic-webpack-typescript-seed

What to do from here?

Useful NPM scripts

  • serve: Creates a local instance of your app running on your default browser. Everytime you change your code, the page is automatically reloaded.
  • build:development: Build your development app to test it on a real device or an emulator. The sourcemaps are here and your code is not minified. Everything you need to debug your app.
  • build:production: Everything is minified and ready to go to production.

You can use these scripts by running:

npm run the-script
  • Serve: Creates a local instance of your app running on your default browser. Everytime you change your code, the page is automatically reloaded.

Cordova: add and build your platforms

No Cordova platforms are specified in this seed. You can add and build your own like always:

cordova platforms add ios
cordova build ios