Giter VIP home page Giter VIP logo

webpack-test's Introduction

Motivation

I'm attempting to learn Angular and am about to start using Webpack, rather than using a seed I thought I should run through the basics of Webpack so I'll understand it better.

What is Webpack?

"webpack is a module bundler. webpack takes modules with dependencies and generates static assets representing those modules."

It handles the most common module styles: CommonJs and AMD.

Project details

This is has been quite a messy experimental repo, ideally I will create a further project with a more methodical order.

Possible steps:

  1. Simple js app in 1 folder
  2. App with folder structure
  3. Build using CLI
  4. Add NPM task
  5. run using web pack server
  6. split configuration (see developing_with_webpack )
  7. Use Hot Module Replacement (HMR)
  8. Add source maps
  9. Add typescript
  10. Add profiler
  11. Add SASS

Run

$ webpack ./entry.js bundle.js

With CSS Binding

webpack ./entry.js bundle.js --module-bind 'css=style!css'

With Config

# Basic
$ webpack

# With colors and a progress bar
$ webpack --progress --colors

# Watch mode
$ webpack --progress --colors --watch

With Server

$ webpack-dev-server --progress --colors

# Run from
# http://localhost:8080/webpack-dev-server/bundle

Or via NPM

$ npm run go

Notes

Typescript

I had real issues with this module, the webpack-dev-server was not running correctly. The build was providing me with an error

ERROR in /Users/factornine/localhosts/www.factornine.co.uk/development/webpack-test/node_modules/angular2/src/facade/promise.d.ts
(1,10): error TS2661: Cannot re-export name that is not defined in the module.

I simple upgraded by:

npm i typescript@next -D

Dependencies

I've used quite a few plugins and dependancies, I'll list a few here:

Annoying Logs

ts-loader: Using [email protected] and /Users/factornine/localhosts/www.factornine.co.uk/development/webpack-test/tsconfig.json
Hash: 6ceb2fc32b93d6dfa9c6
Version: webpack 1.13.0
Time: 6238ms
    Asset     Size  Chunks             Chunk Names
bundle.js  4.09 MB       0  [emitted]  main
    + 218 hidden modules

ERROR in /Users/factornine/localhosts/www.factornine.co.uk/development/webpack-test/node_modules/angular2/src/facade/promise.d.ts
(1,10): error TS2661: Cannot export 'Promise'. Only local declarations can be exported from a module.

Links

This was the best guide: developing_with_webpack

Getting Started

TypeScript and webpack

Smarter CSS builds with Webpack

faster-sass-builds-with-webpack

github.com/jtangelder/sass-loader

angular2-webpack-starter

Using node more SO

For SASS [introduction-to-webpack-with-practical-examples])http://julienrenaux.fr/2015/03/30/introduction-to-webpack-with-practical-examples/)

es6

Modulization-and-Bundling-with-TypeScript-and-Webpack-for-JS-Full-Stack-Project/

Angular 1

Quickstart to Webkit

ng2-webpack-play

I was having a real issue with the typescript hot loading working

Using npm run start

Working with React - Hot loading React Components in TypeScript

Issue webpack/webpack-dev-server#24

angular2-hmr Used in the ng seed bit I couldn't find put how to get this working.

webpack-test's People

Contributors

russellf9 avatar

Watchers

James Cloos avatar  avatar

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.