vuejs / vue-loader

📦 Webpack loader for Vue.js components
MIT License
4.99k stars 915 forks source link

can't change delimiters when build for production #132

Closed libotony closed 8 years ago

libotony commented 8 years ago

I use swig and Vue.js together in a express application, so I change Vue's delimiters like below:

Vue.config.delimiters = ['<<','>>'];
Vue.config.unsafeDelimiters = ['<<<', '>>>'];

I use webpack-dev-server for hot reloading when developing,this works fine,but when I run wepback -p,there is an error,so I change the delimiters to default value,it works fine.

Any suggestions?

// index.js
var Vue = require('vue');
var list = require('./components/list.vue');

Vue.config.delimiters = ['<<','>>'];
Vue.config.unsafeDelimiters = ['<<<', '>>>'];

var vm = new Vue({
  el: 'div.list',
  data: {
    items : []
  },
  components :{
    list : list
  }
});

//list.vue
<template>
  <div>
    <div class="item"  v-for="item in items" track-by="_id">
          <p><< item.name >></p>
    </div>
  </div>
</template>
<script>
  module.exports = {
    props:['items']
  }
</script>
libotony commented 8 years ago

I think I konw why,<and>are key charactors to vue-html-loader