https://github.com/webpack/webpack-with-common-libs
webpack with some common libraries
https://github.com/webpack/webpack-with-common-libs
Last synced: 4 months ago
JSON representation
webpack with some common libraries
- Host: GitHub
- URL: https://github.com/webpack/webpack-with-common-libs
- Owner: webpack
- License: mit
- Archived: true
- Created: 2014-01-10T09:38:59.000Z (about 12 years ago)
- Default Branch: master
- Last Pushed: 2016-07-03T09:06:25.000Z (over 9 years ago)
- Last Synced: 2024-10-30T00:58:51.519Z (over 1 year ago)
- Language: JavaScript
- Size: 1.62 MB
- Stars: 339
- Watchers: 10
- Forks: 104
- Open Issues: 8
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# webpack with common libs
## Build and run
``` sh
# First install dependencies
$ npm install
# And install CLI
$ npm install webpack webpack-dev-server grunt-cli
```
### Native
``` sh
# Build with production config
$ webpack -p --colors
# Build with development config
$ webpack -d --colors
$ open index.html
```
``` sh
# 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
``` sh
# 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
```
``` sh
# 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.