1.0.4 • Published 7 years ago

mt-loader v1.0.4

Weekly downloads
1
License
ISC
Repository
github
Last release
7 years ago

marionette-loader npm version

backbone.mariontte Webpack 组件加载器

It allows you to write your components in this format:

// app.mt
<template>
    <div class='a' > <%- msg %></div>
</template>

<script>
  import Page from   '../page'
  export  default   class  extends Page {
     initialize(options) {
       this.model=new Backbone.Model({msg:'hello world'});
     }
     onRender(){ 
       
     }
  }
</script>

<style lang='sass'>
  .a{
    color:red;
  }
</style>

Basic Usage

Config Webpack:

// webpack.config.js
module.exports = {
  entry: './main.js',
  output: {
    filename: 'build.js'
  },
  module: {
    loaders: [
      {
            test: /\.mt$/,
            loader: 'mt-loader'
      },
    ]
  }
}