You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@weex.apache.org by so...@apache.org on 2017/04/05 09:45:12 UTC
[2/8] incubator-weex git commit: * [html5] update build & test config.
* [html5] update build & test config.
Project: http://git-wip-us.apache.org/repos/asf/incubator-weex/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-weex/commit/fed56d4b
Tree: http://git-wip-us.apache.org/repos/asf/incubator-weex/tree/fed56d4b
Diff: http://git-wip-us.apache.org/repos/asf/incubator-weex/diff/fed56d4b
Branch: refs/heads/0.12-dev
Commit: fed56d4bbf685c91e8321002d46b34fe367846c6
Parents: 9c97d35
Author: MrRaindrop <te...@gmail.com>
Authored: Fri Mar 31 17:31:37 2017 +0800
Committer: MrRaindrop <te...@gmail.com>
Committed: Fri Mar 31 17:31:37 2017 +0800
----------------------------------------------------------------------
build/config.js | 5 ++++-
build/karma.vue.conf.js | 17 ++++++++++++-----
2 files changed, 16 insertions(+), 6 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/fed56d4b/build/config.js
----------------------------------------------------------------------
diff --git a/build/config.js b/build/config.js
index ef15574..00c8d9b 100644
--- a/build/config.js
+++ b/build/config.js
@@ -6,7 +6,6 @@ const postcss = require('rollup-plugin-postcss')
const nodeResolve = require('rollup-plugin-node-resolve')
const uglify = require('rollup-plugin-uglify')
const commonjs = require('rollup-plugin-commonjs')
-// const flow = require('rollup-plugin-flow')
const flow = require('rollup-plugin-flow-no-whitespace')
const buble = require('rollup-plugin-buble')
const subversion = require('../package.json').subversion
@@ -108,6 +107,10 @@ function getConfig (name, minify) {
config.plugins.push(uglify())
}
else {
+ /**
+ * rollup-plugin-flow will cause soucemap problem.
+ * use rollup-plugin-flow-no-whitespace can fixe this.
+ */
config.sourceMap = 'inline'
config.plugins.unshift(eslint({ exclude: ['**/*.json', '**/*.css'] }))
}
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/fed56d4b/build/karma.vue.conf.js
----------------------------------------------------------------------
diff --git a/build/karma.vue.conf.js b/build/karma.vue.conf.js
index 8844594..9a91a94 100644
--- a/build/karma.vue.conf.js
+++ b/build/karma.vue.conf.js
@@ -1,12 +1,13 @@
var rollupConfig = require('./config')('weex-vue-render', true)
var path = require('path')
+var flow = require('rollup-plugin-flow')
function absolute (pa) {
return path.resolve(__dirname, pa)
}
var removeConfigs = ['entry', 'dest', 'banner']
-var removePlugins = ['eslint', 'uglify']
+var removePlugins = ['eslint', 'uglify', 'flow-remove-type']
removeConfigs.forEach(cfg => {
delete rollupConfig[cfg]
@@ -29,6 +30,14 @@ for (var i = 0, l = plugins.length; i < l; i++) {
if (!isRemove) { rollupConfig.plugins.push(plg) }
}
+/**
+ * rollup-plugin-flow-no-whiitespace cause fatial error.
+ * use rollup-plugin-flow instead, since no soucemap needed, it's acceptable for extra whitespaces.
+ */
+rollupConfig.plugins.splice(-2, 1, flow())
+
+console.log('rollupConfig', rollupConfig)
+
rollupConfig.format = 'iife'
rollupConfig.sourceMap = 'inline'
@@ -38,13 +47,11 @@ module.exports = function (config) {
browsers: ['PhantomJS'],
files: [
'../html5/test/render/vue/**/*.js'
- // '../html5/test/render/vue/components/*.js'
],
exclude: [
'../html5/test/render/vue/helper.js',
'../html5/test/render/vue/vender/**/*.js'
- // '../html5/test/render/vue/examples/**/*.js'
],
// singleRun: false,
@@ -59,8 +66,8 @@ module.exports = function (config) {
},
preprocessors: {
- '../html5/test/**/*.js': ['rollup', 'coverage'],
- // '../html5/test/**/!(components|examples)/*.js': ['rollup', 'coverage']
+ '../html5/test/**/*.js': ['rollup'],
+ '../html5/test/**/!(components|examples)/*.js': ['rollup', 'coverage']
},
rollupPreprocessor: rollupConfig,