Skip to content

Commit

Permalink
more build tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
yyx990803 committed Aug 28, 2016
1 parent 961d109 commit 97476a4
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 21 deletions.
9 changes: 1 addition & 8 deletions .babelrc
Original file line number Diff line number Diff line change
@@ -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"
Expand Down
12 changes: 12 additions & 0 deletions build/alias.js
Original file line number Diff line number Diff line change
@@ -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')
}
2 changes: 1 addition & 1 deletion build/karma.base.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ var webpackConfig = {
loaders: [
{
test: /\.js$/,
loader: 'babel!eslint',
loader: 'babel',
exclude: /node_modules/
}
]
Expand Down
12 changes: 6 additions & 6 deletions build/rollup-plugin-flow.js
Original file line number Diff line number Diff line change
@@ -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)
}
Expand Down
11 changes: 5 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
},
Expand All @@ -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",
Expand Down Expand Up @@ -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"
}
}

0 comments on commit 97476a4

Please sign in to comment.