forked from nativescript-vue/nativescript-vue
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrollup.config.js
More file actions
93 lines (86 loc) · 2.37 KB
/
rollup.config.js
File metadata and controls
93 lines (86 loc) · 2.37 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
import alias from 'rollup-plugin-alias'
import commonjs from 'rollup-plugin-commonjs'
import buble from 'rollup-plugin-buble'
import replace from 'rollup-plugin-replace'
import flow from 'rollup-plugin-flow-no-whitespace'
import path from 'path'
const Vue = require('vue/package.json')
const NSVue = require('./package.json')
const banner = `
/*!
* NativeScript-Vue v${NSVue.version}
* (Using Vue v${Vue.version})
* (c) 2017 rigor789
* Released under the MIT license.
*/
`
const resolveVue = p => {
return path.resolve(__dirname, 'node_modules', 'vue/src/', p) + '/'
}
const aliases = {
vue: resolveVue('core/index'),
compiler: resolveVue('compiler'),
web: resolveVue('platforms/web'),
core: resolveVue('core'),
shared: resolveVue('shared'),
sfc: resolveVue('sfc'),
//he: path.resolve(__dirname, 'node_modules', 'he', 'he')
he: path.resolve(__dirname, 'platform/nativescript/util/entity-decoder')
}
export default {
entry: './platform/nativescript/framework.js',
format: 'cjs',
dest: './dist/index.js',
moduleName: 'NativeScript-Vue',
sourceMap: true,
plugins: [
flow(),
replace({
__WEEX__: false,
__VERSION__: Vue.version,
'process.env.NODE_ENV': "'development'",
'let _isServer': 'let _isServer = false',
'process.env.VUE_VERSION': `'${Vue.version}'`,
'process.env.NS_VUE_VERSION': `'${NSVue.version}'`
}),
buble({
transforms: {
arrow: false,
classes: false,
collections: false,
computedProperty: false,
conciseMethodProperty: false,
constLoop: false,
dangerousForOf: false,
dangerousTaggedTemplateString: false,
defaultParameter: false,
destructuring: false,
forOf: false,
generator: false,
letConst: true,
modules: false,
numericLiteral: false,
parameterDestructuring: false,
reservedProperties: false,
spreadRest: false,
stickyRegExp: false,
templateString: false,
unicodeRegExp: false,
}
}),
alias(aliases),
commonjs({
include: [
path.resolve(__dirname, 'node_modules', 'vue') + '/**',
//path.resolve(__dirname, 'node_modules', 'he') + '/**',
],
namedExports: {
'he': ['decode']
}
})
],
external(id) {
return id.startsWith('ui/') || id.startsWith('application')
},
banner
}