Skip to content

Commit

Permalink
Add hook for bundle with webpack before preparing
Browse files Browse the repository at this point in the history
  • Loading branch information
kotarella1110 committed May 8, 2018
1 parent 778d475 commit 99d5b65
Show file tree
Hide file tree
Showing 8 changed files with 7,862 additions and 4 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -121,3 +121,6 @@ $RECYCLE.BIN/

# Windows shortcuts
*.lnk


/scripts
3 changes: 3 additions & 0 deletions .npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -114,3 +114,6 @@ $RECYCLE.BIN/

# Windows shortcuts
*.lnk


/src
41 changes: 40 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,48 @@ This plugin integrates [webpack](https://webpack.js.org "webpack") into your Cor
cordova plugin add cordova-plugin-webpack
```

You can bundle using webpack you installed.
By default, the this plugin's webpack is used.

```
npm install webpack
cordova plugin add cordova-plugin-webpack
```

## Usage

**Just create _webpack.config.js_ file in project root!**

Example:

_webpack.config.js_

```js
const path = require('path');

module.exports = {
entry: './src/entry.js',
output: {
path: path.resolve(__dirname, 'www'),
filename: 'bundle.js'
}
};
```

Specify _www_ folder for `output.path` property.

Before preparing your application, it is bundled with webpack.

※ Specifically, to be bundlled before executing the following cordova commands.

- `cordova prepare`
- `cordova platform add`
- `cordova build`
- `cordova run`

## TODO

- [ ] Bundle with webpack before preparing.
- [x] Bundle with webpack before preparing.
- [ ] Live Reload (Hot Module Replacement) with webpack-dev-server.

## License
Expand Down
Loading

0 comments on commit 99d5b65

Please sign in to comment.