chore: merge dev

This commit is contained in:
Guillaume Chau
2018-05-21 17:21:22 +02:00
4 changed files with 20 additions and 6 deletions

View File

@@ -104,6 +104,7 @@ Options:
--dest specify output directory (default: dist)
--target app | lib | wc | wc-async (default: app)
--name name for lib or web-component mode (default: "name" in package.json or entry filename)
--watch watch for changes
```
`vue-cli-service build` produces a production-ready bundle in the `dist/` directory, with minification for JS/CSS/HTML and auto vendor chunk splitting for better caching. The chunk manifest is inlined into the HTML.

View File

@@ -31,6 +31,10 @@ Cypress offers a rich interactive interface for running E2E tests, but currently
We've pre-configured Cypress to place most of the e2e testing related files under `<projectRoot>/tests/e2e`. You can also check out [how to configure Cypress via `cypress.json`](https://docs.cypress.io/guides/references/configuration.html#Options).
## Environment Variables
Cypress doesn't load .env files for your test files the same way as `vue-cli` does for your [application code](https://github.com/vuejs/vue-cli/blob/dev/docs/env.md#using-env-variables-in-client-side-code). Cypress supports a few ways to [define env variables](https://docs.cypress.io/guides/guides/environment-variables.html#) but the easiest one is to use .json files (either `cypress.json` or `cypress.env.json`) to define environment variables. Keep in mind those variables are accessible via `Cypress.env` function instead of regular `process.env` object.
## Installing in an Already Created Project
``` sh

View File

@@ -5,9 +5,9 @@
"tslint:recommended"
],
"linterOptions": {
"exclude": [
"node_modules/**"
]
"exclude": [
"node_modules/**"
]
},
"rules": {
"quotemark": [true, "single"],

View File

@@ -17,7 +17,8 @@ module.exports = (api, options) => {
'--mode': `specify env mode (default: production)`,
'--dest': `specify output directory (default: ${options.outputDir})`,
'--target': `app | lib | wc | wc-async (default: ${defaults.target})`,
'--name': `name for lib or web-component mode (default: "name" in package.json or entry filename)`
'--name': `name for lib or web-component mode (default: "name" in package.json or entry filename)`,
'--watch': `watch for changes`
}
}, async function build (args) {
args.entry = args.entry || args._[0]
@@ -100,8 +101,12 @@ module.exports = (api, options) => {
: webpackConfig
).output.path
if (args.watch) {
webpackConfig.watch = true
}
if (!args.dest && actualTargetDir !== api.resolve(options.outputDir)) {
// user directly modifys output.path in configureWebpack or chainWebpack.
// user directly modifies output.path in configureWebpack or chainWebpack.
// this is not supported because there's no way for us to give copy
// plugin the correct value this way.
console.error(chalk.red(
@@ -148,7 +153,11 @@ module.exports = (api, options) => {
)
log(formatStats(stats, targetDirShort, api))
if (args.target === 'app') {
done(`Build complete. The ${chalk.cyan(targetDirShort)} directory is ready to be deployed.\n`)
if (!args.watch) {
done(`Build complete. The ${chalk.cyan(targetDirShort)} directory is ready to be deployed.\n`)
} else {
done(`Build complete. Watching for changes...`)
}
if (
options.baseUrl === '/' &&
// only log the tips if this is the first build