Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Externalize animejs and hammerjs for lower bundle size #170

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 6 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,21 +51,25 @@ Checkout the <a target="_blank" href="https://shakee93.github.io/vue-toasted/">

## Installation

This plugin now requires [animejs](http://animejs.com/) and [hammerjs](http://hammerjs.github.io/) as peer dependencies for a lower bundle size.

#### Install using npm
```bash
# install it via npm
npm install vue-toasted --save
npm install vue-toasted hammerjs animejs --save
```

#### Install using yarn
```bash
# install it via yarn
yarn add vue-toasted
yarn add vue-toasted hammerjs animejs
```

#### Direct usage with html
```html
<!-- Insert the vue core before vue-toasted -->
<script src="https://unpkg.com/hammerjs@^2.0.8"></script>
<script src="https://unpkg.com/animejs@^2.2.0"></script>
<script src="https://unpkg.com/vue-toasted"></script>

<script>
Expand Down
6 changes: 5 additions & 1 deletion build/webpack.release.core.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,11 @@ module.exports = {
filename: '[name].js',
libraryTarget: 'umd'
},
module: {
externals: {
hammerjs: 'hammerjs',
animejs: 'animejs'
},
module: {
rules: [
{
test: /\.vue$/,
Expand Down
4 changes: 4 additions & 0 deletions build/webpack.release.css.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@ module.exports = {
filename: '[name].css',
libraryTarget: 'umd'
},
externals: {
hammerjs: 'hammerjs',
animejs: 'animejs'
},
module: {
rules: [
{
Expand Down
4 changes: 4 additions & 0 deletions build/webpack.release.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@ module.exports = {
filename: '[name].js',
libraryTarget: 'umd'
},
externals: {
hammerjs: 'hammerjs',
animejs: 'animejs'
},
module: {
rules: [
{
Expand Down
3,091 changes: 192 additions & 2,899 deletions dist/toasted.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/toasted.min.js

Large diffs are not rendered by default.

3,103 changes: 198 additions & 2,905 deletions dist/vue-toasted.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/vue-toasted.min.js

Large diffs are not rendered by default.

11 changes: 7 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 4 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,11 @@
"toastr"
],
"dependencies": {},
"devDependencies": {
"peerDependencies": {
"animejs": "^2.2.0",
"hammerjs": "^2.0.8"
},
"devDependencies": {
"autoprefixer": "^7.2.6",
"babel-cli": "^6.26.0",
"babel-core": "^6.26.3",
Expand All @@ -45,7 +48,6 @@
"es6-object-assign": "^1.1.0",
"extract-text-webpack-plugin": "^2.1.2",
"file-loader": "^0.9.0",
"hammerjs": "^2.0.8",
"node-sass": "^4.13.1",
"postcss-loader": "^2.1.6",
"requirejs": "^2.3.6",
Expand Down