项目作者: jardenliu

项目描述 :
A Nwjs(node-webkit) development starter using Webpack.
高级语言: JavaScript
项目地址: git://github.com/jardenliu/node-webkit-webpack-starter.git
创建时间: 2017-05-18T07:03:38Z
项目社区:https://github.com/jardenliu/node-webkit-webpack-starter

开源协议:

下载


node-webkit-webpack-starter

A Nwjs(node-webkit) development starter using Webpack.

  • Heavily commented webpack configuration with reasonable defaults
  • ES6, and ES7 support with babel
  • Development server using express with hot reload
  • No gulp and no grunt, just npm scripts.

Warning: Make sure you’re using Node.js and NPM

Quick start

Clone/Download the repo then edit index.js inside /app
```

clone this repo

$ git clone https://github.com/jarden-liu/node-webkit-webpack-starter.git my-nw-app

change directory to your app

$ cd my-nw-app

install the dependencies with npm or cnpm(Chinese Mirror)

$ npm install

install nwjs sdk

$ sudo npm install -g nw —nwjs_build_type=sdk

start the server

$ npm dev

  1. ## Table of Contents
  2. * [Configure](#configure)
  3. * [Getting Started](#getting-started)
  4. * [Dependencies](#dependencies)
  5. * [Installing](#installing)
  6. * [Running the app](#running-the-app)
  7. * [Pack the app](#pack-the-app)
  8. * [License](#license)
  9. ## Configure
  10. > Configure your project by edit `config.js` inside `/build`

const DEFAULT_CONFIG = {
TITLE: ‘node-webkit’ // index.html head title
};

const SERVER_CONFIG = {
PORT: 8081 //local dev server port
};

const PATH_CONFIG = {
MAIN: ‘app’, // app entry dir
OUTPUT: ‘dist’ // app output dir
};

const RESOLVE_CONFIG = {
EXTENSIONS: [‘.js’, ‘.json’], //webpck extensions
ALIAS:{} //webpck alias
};

  1. > You can also configure `webpack.config.js``webpack.dev.js``webpack.prod.js`
  2. ## Getting Started
  3. ### Dependencies
  4. What you need to run this app:
  5. * `node` and `nw` (Use NVM)
  6. * this last version is recommended
  7. ### Installing
  8. * `fork` this repo
  9. * `clone` your fork
  10. * `npm install` to install all dependencies
  11. ### Running the app
  12. After you have installed all dependencies you can now run the app with:

npm start

  1. It will start a local server using `express` with `webpack-dev-middleware` which will watch,rebuild,reload for you.The port will be displayed to you in terminal.As the same time, the nwjs client will auto start.
  2. ### Pack the app
  3. After you've developed app, you can build and compress the app with:

npm run build
`` then the bundle files are placed on the output dire.g. /dist`

How to package your app by dist file?

see http://docs.nwjs.io/package-your-app

License

MIT