This repository has been archived by the owner. It is now read-only.
webpack with some common libraries
JavaScript PHP CSS
Switch branches/tags
Nothing to show
Clone or download
Latest commit 617e775 Jun 2, 2014
Permalink
Failed to load latest commit information.
app added react Jun 2, 2014
web_modules Initial commit Jan 10, 2014
.gitignore Initial commit Jan 10, 2014
Gruntfile.js added react Jun 2, 2014
LICENSE Initial commit Jan 10, 2014
README.md Typo fix Apr 7, 2014
bootstrap.html Initial commit Jan 10, 2014
gulpfile.js added react Jun 2, 2014
index.html added react Jun 2, 2014
jquery.html Initial commit Jan 10, 2014
package.json added react Jun 2, 2014
react.html added react Jun 2, 2014
webpack.config.js added react Jun 2, 2014

README.md

webpack with common libs

Build and run

# First install dependencies
$ npm install

# And install CLI
$ npm install webpack webpack-dev-server grunt-cli

Native

# Build with production config
$ webpack -p --colors

# Build with development config
$ webpack -d --colors

$ open index.html
# Build and watch with development server
$ webpack-dev-server -d --colors

# Just open
$ open http://localhost:8080/

# Auto reloading
$ open http://localhost:8080/webpack-dev-server/xxx.html
# i. e. http://localhost:8080/webpack-dev-server/jquery.html

With grunt

# Development server
$ grunt

# Just open
$ open http://localhost:8080/

# Auto reloading
$ open http://localhost:8080/webpack-dev-server/xxx.html
# i. e. http://localhost:8080/webpack-dev-server/jquery.html
# Build with procuction config
$ grunt build

$ open index.html

Libraries

jquery + jquery-ui

Files: jquery.html with app/jquery

jQuery versions >= 1.10 have commonjs support. For this versions no special config is required.

jQuery version 1.9 has only AMD support, but also needs a amd: { jQuery: true } in the webpack.config.js

jQuery-ui has no commonjs/AMD support. It expects jQuery as global variable. Currently jQuery expose ifself as global variable even if a module system is found, but this may change. One can use the webpack.ProvidePlugin (see webpack.config.js) to provide modules as (fake) global variables.