Skip to content
This repository has been archived by the owner on Feb 13, 2024. It is now read-only.

Commit

Permalink
feat(Webpack): lazy load and chunks
Browse files Browse the repository at this point in the history
  • Loading branch information
xiazeyu committed Dec 30, 2017
1 parent 23ba71c commit ccbe0d0
Show file tree
Hide file tree
Showing 38 changed files with 11,092 additions and 147 deletions.
11 changes: 11 additions & 0 deletions .babelrc
@@ -0,0 +1,11 @@
{
"presets": [
["env",{
"debug": true
}]
],
"plugins": [
"syntax-dynamic-import"
]
}

File renamed without changes.
111 changes: 111 additions & 0 deletions .github/CONTRIBUTING.md
@@ -0,0 +1,111 @@
# Contributing


## Issues

- Most of the time, if this plugin is not working correctly for you it is a simple **configuration** issue.

- **Search on the internet** and **among closed issues** in advance would do a great help for us.

- Please **keep focus on the topic** of any issue, and use **English** as far as possible so that everyone will understand you.

- **If you have discovered a bug or have a feature suggestion, feel free to create an issue on Github.**


## Contributing directly to the source code

**Working on your first Pull Request?** You can learn how from this *free* series
[How to Contribute to an Open Source Project on GitHub](https://egghead.io/series/how-to-contribute-to-an-open-source-project-on-github)

See workflow for more code developing information.


## Submitting Changes

After getting some feedback, push to your fork and submit a pull request. We
may suggest some changes or improvements or alternatives, but for small changes
your pull request should be accepted quickly.

Some things that will increase the chance that your pull request is accepted:

- Follow the existing coding style
- Write a good commit message use `npm run commit`
- Make sure that your code can work properly.


## Documentation

live2d-widget.js's feature is now becoming richer and richer, and documentation is a huge time sink.
We greatly appreciate any time spent fixing typos or clarifying sections in the
documentation.

From opening a bug report to creating a pull request: every contribution is
appreciated and welcome. If you're planning to implement a new feature or change
the api please create an issue first. This way we can ensure that your precious
work is not in vain.



## Workflow: modify the code

- We use **[EditorConfig](http://editorconfig.org/)** to define and maintain consistent coding styles, so have a look first.

- Please use the latest version of Node.js to work with.

### 1. Install environments

- Use `npm run inst:dev` to install all the environments.

### 2. Make changes

- Modify files in `/src/`

- Use `npm run build:dev` to build client js files **with debug files and watchdog.**.

### 3. Debug until you make sure that your code works properly.

### 4. Commit those changes

- **Use `npm run build:prod` to build final client js.**
**Important!!! The step must be done before commit!!!**

- Use `git add *`, or choose the file you want to commit.

- Use `npm run commit` to commit, **Never use `git commit`!!!**

### 5. Push the changes

- Use `git push` to push the changes to the github server.

### 6. Push to the webbranch

- Use `push-gh-pages.bat` or `push-gh-pages.sh`


## Workflow(author): Release a new version

*Let the Collaborator or author do it.*

### 1. Bump the version

- bump the version in `package.json`

- delete `package-lock.json`

- run `npm install` to generate new `package-lock.json`

### 2. Commit package.json and package-lock.json

- Use `npm run commit` to commit, **Never use `git commit`!!!**

### 3. Tag and release a new version

- In the Github page.

### 4. Update changelog

- Use `npm run changelog`

### 5. Publish the package to npm.

- Use `npm publish` to publish it.
File renamed without changes.
File renamed without changes.
3 changes: 3 additions & 0 deletions .gitignore
Expand Up @@ -35,3 +35,6 @@ jspm_packages

# Optional REPL history
.node_repl_history

# Developing folder
dev
208 changes: 208 additions & 0 deletions README.md
@@ -0,0 +1,208 @@
[![npm][npm]][npm-url]
[![deps][deps]][deps-url]
[![devdeps][devdeps]][devdeps-url]

[![downloads][downloads]][downloads-url]
[![downloads-month][downloads-month]][downloads-month-url]

[![GitHub stars][GitHub stars]][GitHub stars-url]
[![GitHub forks][GitHub forks]][GitHub forks-url]
[![GitHub issues][GitHub issues]][GitHub issues-url]

[![Commitizen friendly][Commitizen friendly]][Commitizen friendly-url]
[![PRs Welcome][PRs Welcome]][PRs Welcome-url]
[![license][license]][license-url]


# live2d-widget.js

[简体中文文档](./README.zh-CN.md)

<br>

Add the Sseexxyyy live2d to your webpages!

Demo: [TBD.](javascript:void(0);)

Online generator: [TBD.](javascript:void(0);)


## Installation

### Hexo

Please visit [hexo-helper-live2d](https://github.com/EYHN/hexo-helper-live2d) for the hexo plugin.

### Webpack

Install the module:

```
npm install --save live2d-widet.js
```

Import the module:

```js
// using as es modules
import 'live2d-widget.js';
```

Then call the function with your config.

```js
loadL2D({
'config1': 'value1',
'config2': 'value2',
});
```

### Online

TBD.

## Settings

See src/SettingTip.txt

<details><summary>Current supported models:</summary><br>

- `chitose`
- `Epsilon2.1`
- `Gantzert_Felixander`
- `haru01`
- `haru02`
- `haruto`
- `hibiki`
- `hijiki`
- `izumi`
- `koharu`
- `miku`
- `nico`
- `ni-j`
- `nipsilon`
- `nito`
- `shizuku`
- `tororo`
- `tsumiki`
- `Unitychan`
- `wanko`
- `z16`

</details>

## Custom model

1. Create a `live2d_models` folder at your blog's root directory.

2. Create a folder by the name of your model.

3. Copy your model to this folder.

**Attention! The path of the model's json must be `/live2d_models/{name}/{name}.model.json`**

<details><summary>An Example:</summary><br>

Your model is named `mymiku`.

Then, create a folder at `/` (Which should exists `_config.yml``sources``themes` ) named `mymiku`.

Copy your model to `/live2d_models/mymiku/`.

Up to now, there should be `mymiku.model.json` in the directory of `/live2d_models/mymiku/`.

</details>

<br>~The problem was once releated to [(#22)](https://github.com/EYHN/hexo-helper-live2d/issues/22).~

<br>

Enjoy!:beer:

> This is my first hexo plugin, star :star: and watch :eyeglasses:, pull request is also welcomed.
Github: [https://github.com/EYHN/hexo-helper-live2d](https://github.com/EYHN/hexo-helper-live2d)

issues: [https://github.com/EYHN/hexo-helper-live2d/issues](https://github.com/EYHN/hexo-helper-live2d/issues)


## Contribute

**Please pay enough attention to this document if you want to commit your changes or submit issues.**

[CONTRIBUTING](./CONTRIBUTING.md)

## Releated projects

- [Cubism SDK WebGL 2.1](http://sites.cybernoids.jp/cubism-sdk2_e/webgl2-1)

- [pixi-live2d](https://github.com/avgjs/pixi-live2d)

- [CubismJsComponents](https://github.com/Live2D/CubismJsComponents)

- [live2d-widget.js](https://github.com/xiazeyu/live2d-widget.js)

- [hexo-helper-live2d](https://github.com/EYHN/hexo-helper-live2d)


## About me

[![Author][author]][author-url]

[![QQ][qq]][qq-url]

[![Email][email]][email-url]


## Imported

[![current-device][current-device]][current-device-url]

<br>

Open sourced under the GPL v2.0 license.

[npm]: https://badge.fury.io/js/hexo-helper-live2d.svg?label=hexo-helper-live2d
[npm-url]: https://www.npmjs.com/package/hexo-helper-live2d

[deps]: https://img.shields.io/david/EYHN/hexo-helper-live2d.svg
[deps-url]: javascript:void(0);

[devdeps]: https://img.shields.io/david/dev/EYHN/hexo-helper-live2d.svg
[devdeps-url]: javascript:void(0);

[license]: https://img.shields.io/github/license/EYHN/hexo-helper-live2d.svg
[license-url]: https://github.com/EYHN/hexo-helper-live2d/blob/master/LICENSE

[PRs Welcome]: https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=flat-square
[PRs Welcome-url]: http://makeapullrequest.com

[downloads]: https://img.shields.io/npm/dt/hexo-helper-live2d.svg
[downloads-url]: https://www.npmjs.com/package/hexo-helper-live2d

[downloads-month]: https://img.shields.io/npm/dm/hexo-helper-live2d.svg
[downloads-month-url]: https://www.npmjs.com/package/hexo-helper-live2d

[Commitizen friendly]: https://img.shields.io/badge/commitizen-friendly-brightgreen.svg
[Commitizen friendly-url]: http://commitizen.github.io/cz-cli/

[GitHub stars]: https://img.shields.io/github/stars/EYHN/hexo-helper-live2d.svg
[GitHub stars-url]: https://github.com/EYHN/hexo-helper-live2d/stargazers

[GitHub forks]: https://img.shields.io/github/forks/EYHN/hexo-helper-live2d.svg
[GitHub forks-url]: https://github.com/EYHN/hexo-helper-live2d/network

[GitHub issues]: https://img.shields.io/github/issues/EYHN/hexo-helper-live2d.svg
[GitHub issues-url]: https://github.com/EYHN/hexo-helper-live2d/issues

[author]: https://img.shields.io/badge/author-cneyhn-green.svg
[author-url]: https://delusion.coding.me/

[qq]: https://img.shields.io/badge/QQ-1106996185-blue.svg
[qq-url]: http://wpa.qq.com/msgrd?v=3&uin=&site=qq&menu=yes

[email]: https://img.shields.io/badge/Emali%20me-cneyhn@gmail.com-green.svg
[email-url]: mailto:cneyhn@gmail.com

[current-device]: https://img.shields.io/npm/v/current-device.svg?label=current-device
[current-device-url]: https://github.com/matthewhudson/current-device

0 comments on commit ccbe0d0

Please sign in to comment.