mt-loader

1.0.4 • Public • Published

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'
      },
    ]
  }
}

Package Sidebar

Install

npm i mt-loader

Weekly Downloads

1

Version

1.0.4

License

ISC

Last publish

Collaborators

  • charlie_lau