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-angular2-webpack-full-config

v4.0.0

Published

Generator Yoeman starter angular2 project with webpack

Downloads

20

Readme

Starter Angular with webpack config

A yeoman generator, letting you to create easely an angular (version 5) web application with webpack (version 3) as module bundler

node npm angular webpack build dependencies license

Table of Contents

Requirements

Starter Angular requires the folowing to run:

  • Node.js: 4.x.x+
  • NPM: 3.x.x+ (normally comes with node js)
  • Yo: 1.x.x+

Installation

To install Node js, go to their Home Page

To install Yo, paste this command line in your favorite term:

npm install -g yo

To install this yoeman's generator, paste this command line:

npm install -g generator-angular2-webpack-full-config

To launch this generator, and create your web-application, paste this command line

yo angular2-webpack-full-config

Finally, you must have all the necessary dependencies. For that, go to your App folder that you just created, and paste this command line

npm install

Structure Angular Project

This starter project respects Angular's best practices. To organize your project with those best practices, refer to Angular Home Page

Development Mode

The development mode is realized by webpack-dev-server (version 1). To launch this server, go to your app folder and paste this command line

npm start

This command launch the development server on port 8000 of your localhost. There is an auto reload system for saving time in your development

Production Mode

In production mode, all the project is minified. To build your application, in your app folder, paste this command line

npm run build:prod

Then to deploy your application, you have two choices:

  • a node server, with the framework hapi (documentation here)
  • a little server, easy to use: superstatic (documentation here)

To launch server in production mode with the node server, in your app folder, paste this command line

npm run prod

To launch server in production mode with superstatic, in your app folder, paste this command line

npm run serve:prod

Configuration style (css/scss)

Now you can use sass or css to styling your application. Only difference is the method of import.

To import a sass file in a typescript file, here is an example:

import '!style-loader!css-loader!sass-loader!path to your sass file'

In an angular component it's necessary to stringify your sass file, here is the syntax

styles:[require('path to sass file').toString()]

You can also include your sass file in the main sass file like this:

@import 'path to your sass file'

To import a css file in a typescript file, here is an exemple:

import '!style-loader!css-loader!path to your css file '

In an Angular component, just require your css file like this

styles:[require('path to your css file')]

Dependencies

If your projet needs more dependencies you must import them in the vendor file. Some exemples are already present in this file.

Docker

Now your application can be deploy in a Docker container. All scripts are already done. These scripts are in the script folder. You just must change 'name_of_your_image:tag' by your really app name image and the the version of your tag.

To lauch a script, go to the script folder, and in a terminal

sh name_of_your_script_file

Documentation

Create documentation for your application is very easy now with compoDoc. To create doc, in a terminal, paste this command line

npm run compodoc

This command line will create a documentation folder called 'documentation'. To see the documentation, you must serve it on a server. For this, paste this command line

sh npm run servedoc

For more option, you can go the the official webpage of compoDoc

License

generator-angular2-webpack-full-config is licensed under the MIT license.
Copyright © 2016, Nicolas FRIZZARIN