Skip to content

Commit

Permalink
some small updates to the docs
Browse files Browse the repository at this point in the history
  • Loading branch information
LinusBorg committed Dec 2, 2017
1 parent 13c8858 commit d0b9007
Show file tree
Hide file tree
Showing 5 changed files with 55 additions and 17 deletions.
28 changes: 21 additions & 7 deletions docs/backend.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,31 @@ Let's take a look at the default `config/index.js`:
const path = require('path')

module.exports = {
dev: {
/ Paths
assetsSubDirectory: 'static',
assetsPublicPath: '/',
proxyTable: {},

// Various Dev Server settings
host: 'localhost',
port: 8080,

// skipping other options as they are only convenience features
},
build: {
index: path.resolve(__dirname, 'dist/index.html'),
assetsRoot: path.resolve(__dirname, 'dist'),
// Template for index.html
index: path.resolve(__dirname, '../dist/index.html'),

// Paths
assetsRoot: path.resolve(__dirname, '../dist'),
assetsSubDirectory: 'static',
assetsPublicPath: '/',
productionSourceMap: true

productionSourceMap: true,

// skipping the rest ...
},
dev: {
port: 8080,
proxyTable: {}
}
}
```

Expand Down
4 changes: 4 additions & 0 deletions docs/commands.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,3 +36,7 @@ All build commands are executed via [NPM Scripts](https://docs.npmjs.com/misc/sc
- Works with one command out of the box:
- Selenium and chromedriver dependencies automatically handled.
- Automatically spawns the Selenium server.

### `npm run lint`

> Runs eslint and reports any linting errors in your code. See [Linter Configuration](linter.md)
11 changes: 11 additions & 0 deletions docs/linter.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,14 @@ If you are not happy with the default linting rules, you have several options:
2. Pick a different ESLint preset when generating the project, for example [eslint-config-airbnb](https://github.com/airbnb/javascript/tree/master/packages/eslint-config-airbnb).

3. Pick "none" for ESLint preset when generating the project and define your own rules. See [ESLint documentation](https://eslint.org/docs/rules/) for more details.

## Fixing Linting Errors

You can run the following command to let eslint fix any errors it finds (if it can - not all errors are fixable like this):

```
npm run lint -- --fix
```

*(The `--` in the middle is necessary to ensure the `--fix` option is passdd to `eslint`, not to `npm`)*

14 changes: 9 additions & 5 deletions docs/pre-processors.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,18 @@ Once installed, you can use the pre-processors inside your `*.vue` components us

### PostCSS

Styles in `*.vue` files are piped through PostCSS by default, so you don't need to use a specific loader for it. You can simply add PostCSS plugins you want to use in `build/webpack.base.conf.js` under the `vue` block:
Styles in `*.vue` files and style files (`*.css`, `*.scss` etc) are piped through PostCSS by default, so you don't need to use a specific loader for it.

You can simply add PostCSS plugins you want to use to the `.postcssrc.js`file in your project's root directory:

``` js
// build/webpack.base.conf.js
// https://github.com/michael-ciniawsky/postcss-load-config

module.exports = {
// ...
vue: {
postcss: [/* your plugins */]
"plugins": {
// to edit target browsers: use "browserslist" field in package.json
"postcss-import": {},
"autoprefixer": {}
}
}
```
Expand Down
15 changes: 10 additions & 5 deletions docs/structure.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,20 +18,25 @@
├── test/
│ └── unit/ # unit tests
│ │ ├── specs/ # test spec files
│ │ ├── setup.js # file that runs before Jest tests
│ │ ├── eslintrc # config file for eslint with extra settings only for unit tests
│ │ ├── index.js # test build entry file
│ │ └── karma.conf.js # test runner config file
│ │ ├── jest.conf.js # Config file when using Jest for unit tests
│ │ └── karma.conf.js # test runner config file when using Karma for unit tests
│ │ ├── setup.js # file that runs before Jest runs your unit tests
│ └── e2e/ # e2e tests
│ │   ├── specs/ # test spec files
│ │   ├── custom-assertions/ # custom assertions for e2e tests
│ │   ├── runner.js # test runner script
│ │   └── nightwatch.conf.js # test runner config file
├── .babelrc # babel config
├── .postcssrc.js # postcss config
├── .editorconfig # indentation, spaces/tabs and similar settings for your editor
├── .eslintrc.js # eslint config
├── .editorconfig # editor config
├── .eslintignore.js # eslint ignore rules
├── .gitignore # sensible defaults for gitignore
├── .postcssrc.js # postcss config
├── index.html # index.html template
└── package.json # build scripts and dependencies
├── package.json # build scripts and dependencies
└── README.md # Default README file
```

### `build/`
Expand Down

0 comments on commit d0b9007

Please sign in to comment.