Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ViewModel.require with component@1.0.0 #306

Merged
merged 1 commit into from
Jun 11, 2014
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
18 changes: 10 additions & 8 deletions src/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,14 @@ var config = require('./config'),
ViewModel = require('./viewmodel'),
utils = require('./utils'),
makeHash = utils.hash,
assetTypes = ['directive', 'filter', 'partial', 'effect', 'component']

// require these so Browserify can catch them
// so they can be used in Vue.require
require('./observer')
require('./transition')
assetTypes = ['directive', 'filter', 'partial', 'effect', 'component'],
// Internal modules that are exposed for plugins
pluginAPI = {
utils: utils,
config: config,
transition: require('./transition'),
observer: require('./observer')
}

ViewModel.options = config.globalAssets = {
directives : require('./directives'),
Expand Down Expand Up @@ -83,8 +85,8 @@ ViewModel.use = function (plugin) {
/**
* Expose internal modules for plugins
*/
ViewModel.require = function (path) {
return require('./' + path)
ViewModel.require = function (module) {
return pluginAPI[module]
}

ViewModel.extend = extend
Expand Down