mirror of https://github.com/vuejs/vue.git
restructure
This commit is contained in:
parent
c9c4291586
commit
0ab0600599
|
|
@ -16,17 +16,17 @@ var banner =
|
|||
|
||||
// update main file
|
||||
var main = fs
|
||||
.readFileSync('src/index.js', 'utf-8')
|
||||
.readFileSync('src/runtime/index.js', 'utf-8')
|
||||
.replace(/Vue\.version = '[\d\.]+'/, "Vue.version = '" + version + "'")
|
||||
fs.writeFileSync('src/index.js', main)
|
||||
fs.writeFileSync('src/runtime/index.js', main)
|
||||
|
||||
// CommonJS build.
|
||||
// this is used as the "main" field in package.json
|
||||
// and used by bundlers like Webpack and Browserify.
|
||||
// doesn't come with the compiler because it's meant to be
|
||||
// runtime only, because it's meant to be
|
||||
// used with vue-loader which pre-compiles the template.
|
||||
rollup.rollup({
|
||||
entry: 'src/index.js',
|
||||
entry: 'src/runtime/index.js',
|
||||
plugins: [babel()]
|
||||
})
|
||||
.then(function (bundle) {
|
||||
|
|
@ -38,7 +38,7 @@ rollup.rollup({
|
|||
// Standalone Dev Build
|
||||
.then(function () {
|
||||
return rollup.rollup({
|
||||
entry: 'src/with-compiler.js',
|
||||
entry: 'src/runtime-with-compiler.js',
|
||||
plugins: [
|
||||
alias({
|
||||
entities: './entity-decoder'
|
||||
|
|
@ -60,7 +60,7 @@ rollup.rollup({
|
|||
.then(function () {
|
||||
// Standalone Production Build
|
||||
return rollup.rollup({
|
||||
entry: 'src/with-compiler.js',
|
||||
entry: 'src/runtime-with-compiler.js',
|
||||
plugins: [
|
||||
alias({
|
||||
entities: './entity-decoder'
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
module.exports = require('../src/with-compiler')['default']
|
||||
module.exports = require('../src/runtime-with-compiler')['default']
|
||||
|
|
|
|||
|
|
@ -1,5 +1,4 @@
|
|||
import { isArray } from '../../util/index'
|
||||
|
||||
const isArray = Array.isArray
|
||||
const simplePathRE = /^[A-Za-z_$][\w$]*(?:\.[A-Za-z_$][\w$]*|\['.*?'\]|\[".*?"\]|\[\d+\]|\[[A-Za-z_$][\w$]*\])*$/
|
||||
|
||||
// keyCode aliases
|
||||
|
|
|
|||
|
|
@ -1,12 +1,14 @@
|
|||
import config from './config'
|
||||
import config from './runtime/config'
|
||||
import { compile } from './compiler/index'
|
||||
import { getOuterHTML, query } from './util/index'
|
||||
import Component from './instance/index'
|
||||
import { getOuterHTML, extend, query } from './runtime/util/index'
|
||||
import Instance from './runtime/index'
|
||||
|
||||
export default function Vue (options) {
|
||||
if (!options.render) {
|
||||
const template = options.template || getOuterHTML(query(options.el))
|
||||
options.render = compile(template, config.preserveWhiteSpace)
|
||||
}
|
||||
return new Component(options)
|
||||
return new Instance(options)
|
||||
}
|
||||
|
||||
extend(Vue, Instance)
|
||||
|
|
@ -1,3 +1,5 @@
|
|||
import Vue from './instance/index'
|
||||
|
||||
Vue.version = '2.0.0'
|
||||
|
||||
export default Vue
|
||||
Loading…
Reference in New Issue