more build tweaks

This commit is contained in:
Evan You 2016-08-27 21:13:55 -04:00
parent 961d109148
commit 97476a4185
5 changed files with 25 additions and 21 deletions

View File

@ -1,12 +1,5 @@
{
"env": {
"development": {
"presets": ["es2015", "flow-vue"]
},
"production": {
"presets": ["es2015-rollup-vue", "flow-vue"]
}
},
"presets": ["es2015", "flow-vue"],
"ignore": [
"dist/*.js",
"packages/**/*.js"

12
build/alias.js Normal file
View File

@ -0,0 +1,12 @@
const path = require('path')
module.exports = {
vue: path.resolve(__dirname, '../src/entries/web-runtime-with-compiler'),
compiler: path.resolve(__dirname, '../src/compiler'),
core: path.resolve(__dirname, '../src/core'),
shared: path.resolve(__dirname, '../src/shared'),
web: path.resolve(__dirname, '../src/platforms/web'),
server: path.resolve(__dirname, '../src/server'),
entries: path.resolve(__dirname, '../src/entries'),
sfc: path.resolve(__dirname, '../src/sfc')
}

View File

@ -11,7 +11,7 @@ var webpackConfig = {
loaders: [
{
test: /\.js$/,
loader: 'babel!eslint',
loader: 'babel',
exclude: /node_modules/
}
]

View File

@ -1,13 +1,13 @@
var flowRemoveTypes = require('flow-remove-types')
var createFilter = require('rollup-pluginutils').createFilter
const flowRemoveTypes = require('flow-remove-types')
const createFilter = require('rollup-pluginutils').createFilter
module.exports = function(options) {
options = options || {};
var filter = createFilter(options.include, options.exclude)
module.exports = options => {
options = options || {}
const filter = createFilter(options.include, options.exclude)
return {
name: 'flow-remove-types',
transform: function(code, id) {
transform: (code, id) => {
if (filter(id)) {
return flowRemoveTypes(code)
}

View File

@ -17,14 +17,14 @@
"build": "node build/build.js",
"build:ssr": "npm run build -- vue.common.js,vue-server-renderer",
"test": "npm run lint && flow check && npm run test:cover && npm run test:e2e -- --env phantomjs && npm run test:ssr",
"test:unit": "NODE_ENV=development karma start build/karma.unit.config.js",
"test:cover": "NODE_ENV=development karma start build/karma.cover.config.js",
"test:unit": "karma start build/karma.unit.config.js",
"test:cover": "karma start build/karma.cover.config.js",
"test:e2e": "npm run build -- vue.js && node test/e2e/runner.js",
"test:ssr": "npm run build:ssr && NODE_ENV=development VUE_ENV=server jasmine JASMINE_CONFIG_PATH=test/ssr/jasmine.json",
"test:ssr": "npm run build:ssr && VUE_ENV=server jasmine JASMINE_CONFIG_PATH=test/ssr/jasmine.json",
"test:sauce": "npm run sauce -- 0 && npm run sauce -- 1 && npm run sauce -- 2",
"lint": "eslint src build test",
"flow": "flow check",
"sauce": "NODE_ENV=development SAUCE=true karma start build/karma.sauce.config.js",
"sauce": "SAUCE=true karma start build/karma.sauce.config.js",
"bench:ssr": "npm run build:ssr && NODE_ENV=production VUE_ENV=server node benchmarks/ssr/renderToString.js && NODE_ENV=production VUE_ENV=server node benchmarks/ssr/renderToStream.js",
"release": "bash build/release.sh"
},
@ -47,7 +47,6 @@
"babel-loader": "^6.2.4",
"babel-plugin-coverage": "^1.0.0",
"babel-preset-es2015": "^6.9.0",
"babel-preset-es2015-rollup-vue": "^1.1.0",
"babel-preset-flow-vue": "^1.0.0",
"buble": "^0.13.1",
"chromedriver": "^2.21.2",
@ -87,6 +86,6 @@
"rollup-watch": "^2.5.0",
"selenium-server": "2.53.0",
"uglify-js": "^2.6.2",
"webpack": "^1.13.1"
"webpack": "^1.13.2"
}
}