Skip to content

Add yarn example command #90

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

Open
wants to merge 6 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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 15 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,16 @@ $ npm install
$ npm run dev
```

or use this command for Yarn

``` bash
$ yarn global add vue-cli
$ vue init pwa my-project
$ cd my-project
$ yarn
$ yarn dev
```

If port 8080 is already in use on your machine you must change the port number in `/config/index.js`. Otherwise `npm run dev` will fail.

## What's Included
Expand All @@ -30,27 +40,27 @@ If port 8080 is already in use on your machine you must change the port number i
* Mobile-friendly meta-viewport
* Lighthouse score of 90+/100

- `npm run dev`: first-in-class development experience.
- `npm run dev` or `yarn dev`: first-in-class development experience.
- Webpack + `vue-loader` for single file Vue components.
- State preserving hot-reload
- State preserving compilation error overlay
- Lint-on-save with ESLint
- Source maps

- `npm run build`: Production ready build.
- `npm run build` or `yarn build`: Production ready build.
- JavaScript minified with [UglifyJS](https://github.com/mishoo/UglifyJS2).
- HTML minified with [html-minifier](https://github.com/kangax/html-minifier).
- CSS across all components extracted into a single file and minified with [cssnano](https://github.com/ben-eb/cssnano).
- All static assets compiled with version hashes for efficient long-term caching, and a production `index.html` is auto-generated with proper URLs to these generated assets.
- Use `npm run build --report`to build with bundle size analytics.
- Use `npm run build --report` or `yarn build --report` to build with bundle size analytics.
- Generates a Service Worker for offline caching your static assets using [sw-precache-webpack-plugin](https://www.npmjs.com/package/sw-precache-webpack-plugin)

- `npm run unit`: Unit tests run in PhantomJS with [Karma](http://karma-runner.github.io/0.13/index.html) + [Mocha](http://mochajs.org/) + [karma-webpack](https://github.com/webpack/karma-webpack).
- `npm run unit` or `yarn unit`: Unit tests run in PhantomJS with [Karma](http://karma-runner.github.io/0.13/index.html) + [Mocha](http://mochajs.org/) + [karma-webpack](https://github.com/webpack/karma-webpack).
- Supports ES2015+ in test files.
- Supports all webpack loaders.
- Easy mock injection.

- `npm run e2e`: End-to-end tests with [Nightwatch](http://nightwatchjs.org/).
- `npm run e2e` or `yarn e2e`: End-to-end tests with [Nightwatch](http://nightwatchjs.org/).
- Run tests in multiple browsers in parallel.
- Works with one command out of the box:
- Selenium and chromedriver dependencies automatically handled.
Expand Down
11 changes: 10 additions & 1 deletion docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ If you just want to try out `vue-loader` or whip out a quick prototype, use the

## Quickstart

To use this template, scaffold a project with [vue-cli](https://github.com/vuejs/vue-cli). **It is recommended to use npm 3+ for a more efficient dependency tree.**
To use this template, scaffold a project with [vue-cli](https://github.com/vuejs/vue-cli). **It is recommended to use npm 3+ for a more efficient dependency tree.** or [yarn](https://yarnpkg.com) for a more efficient dependency tree.**

``` bash
$ npm install -g vue-cli
Expand All @@ -15,3 +15,12 @@ $ cd my-project
$ npm install
$ npm run dev
```
or use this command for Yarn

``` bash
$ yarn global add vue-cli
$ vue init pwa my-project
$ cd my-project
$ yarn
$ yarn dev
```
8 changes: 4 additions & 4 deletions docs/commands.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

All build commands are executed via [NPM Scripts](https://docs.npmjs.com/misc/scripts).

### `npm run dev`
### `npm run dev` or `yarn dev`

> Starts a Node.js local development server. See [API Proxying During Development](proxy.md) for more details.

Expand All @@ -12,7 +12,7 @@ All build commands are executed via [NPM Scripts](https://docs.npmjs.com/misc/sc
- Lint-on-save with ESLint
- Source maps

### `npm run build`
### `npm run build` or `yarn build`

> Build assets for production. See [Integrating with Backend Framework](backend.md) for more details.

Expand All @@ -22,15 +22,15 @@ All build commands are executed via [NPM Scripts](https://docs.npmjs.com/misc/sc
- All static assets compiled with version hashes for efficient long-term caching, and a production `index.html` is auto-generated with proper URLs to these generated assets.
- Generates a Service Worker for offline caching your static assets using [sw-precache-webpack-plugin](https://www.npmjs.com/package/sw-precache-webpack-plugin)

### `npm run unit`
### `npm run unit` or `yarn unit`

> Run unit tests in PhantomJS with [Karma](https://karma-runner.github.io/). See [Unit Testing](unit.md) for more details.

- Supports ES2015+ in test files.
- Supports all webpack loaders.
- Easy [mock injection](http://vuejs.github.io/vue-loader/en/workflow/testing-with-mocks.html).

### `npm run e2e`
### `npm run e2e` or `yarn e2e`

> Run end-to-end tests with [Nightwatch](http://nightwatchjs.org/). See [End-to-end Testing](e2e.md) for more details.

Expand Down
2 changes: 1 addition & 1 deletion docs/e2e.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Let's take a look at the files in the `test/e2e` directory:

- `runner.js`

A Node.js script that starts the dev server, and then launches Nightwatch to run tests against it. This is the script that will run when you run `npm run e2e`.
A Node.js script that starts the dev server, and then launches Nightwatch to run tests against it. This is the script that will run when you run `npm run e2e` or `yarn e2e`.

- `nightwatch.conf.js`

Expand Down
5 changes: 5 additions & 0 deletions docs/pre-processors.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@ This boilerplate has pre-configured CSS extraction for most popular CSS pre-proc
``` bash
npm install sass-loader node-sass --save-dev
```
or

``` bash
yarn add sass-loader node-sass --dev
```

Note you also need to install `node-sass` because `sass-loader` depends on it as a peer dependency.

Expand Down
6 changes: 6 additions & 0 deletions docs/prerender.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,12 @@ If you want to prerender routes that will not significantly change once pushed t
npm install --save-dev prerender-spa-plugin
```

or

``` bash
yarn add prerender-spa-plugin --dev
```

2. Require it in **build/webpack.prod.conf.js**:

```js
Expand Down
2 changes: 1 addition & 1 deletion meta.js
Original file line number Diff line number Diff line change
Expand Up @@ -93,5 +93,5 @@ module.exports = {
"test/e2e/**/*": "e2e",
"src/router/**/*": "router"
},
"completeMessage": "To get started:\n\n {{^inPlace}}cd {{destDirName}}\n {{/inPlace}}npm install\n npm run dev\n\nDocumentation can be found at https://vuejs-templates.github.io/webpack"
"completeMessage": "To get started:\n\n {{^inPlace}}cd {{destDirName}}\n {{/inPlace}}npm install\n npm run dev\n\n or \n\n {{^inPlace}}cd {{destDirName}}\n {{/inPlace}}yarn\n yarn dev\n\n Documentation can be found at https://vuejs-templates.github.io/webpack"
};