Skip to content

Commit

Permalink
update example to include source map and work with new api
Browse files Browse the repository at this point in the history
  • Loading branch information
yyx990803 committed Jun 10, 2015
1 parent a419c77 commit 3d75e7b
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 4 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@ node_modules
test/test.build.js
test/test.html
example/example.build.js
example/example.build.js.map
TODOS.md
3 changes: 2 additions & 1 deletion build/webpack.example.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,6 @@ module.exports = {
output: {
path: './example',
filename: 'example.build.js'
}
},
devtool: '#source-map'
}
5 changes: 2 additions & 3 deletions example/example.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ var router = new VueRouter({
root: '/hello'
})

var root = new Vue({
var App = Vue.extend({
components: {
inbox: {
template: '<div><h2>inbox!</h2><router-view></router-view>',
Expand Down Expand Up @@ -99,5 +99,4 @@ router.redirect({
'/info': '/about'
})

router.start(root)
root.$mount('#app')
router.start(App, '#app')
4 changes: 4 additions & 0 deletions example/serve.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ app.get('/example.build.js', function (req, res) {
res.sendFile(__dirname + '/example.build.js')
})

app.get('/example.build.js.map', function (req, res) {
res.sendFile(__dirname + '/example.build.js.map')
})

app.get('*', function (req, res) {
res.sendFile(__dirname + '/index.html')
})
Expand Down

0 comments on commit 3d75e7b

Please sign in to comment.