打包测试环境

按照以下步骤,改完,打包就可以了。只改一次,以后不用改了。
npm run test,打测试包,报错:
Option “mapCoverage” has been removed, as it’s no longer necessary.

解决方法:
复制build/webpack.prod.conf.js文件,把名字改成build/webpack.test.conf.js

复制build/build.js文件,把名字改成build/test.js

修改build/test.js文件,把
process.env.NODE_ENV = ‘production’
const webpackConfig = require(’./webpack.prod.conf’)
const spinner = ora(‘building for production…’)
改成
process.env.NODE_ENV = ‘testing’
const webpackConfig = require(’./webpack.test.conf’)
const spinner = ora(‘building for testing…’)

修改package.json文件,把
“test”: “npm run unit && npm run e2e”,
改成
“test”: “node build/test.js”,

你可能感兴趣的:(vue)