quasar-loader
generates quasar imports and component declarations based on components discovered in the template
Last updated 2 years ago by pjschmidt3 .
MIT · Original npm · Tarball · package.json
$ cnpm install quasar-loader 
SYNC missed versions from official npm registry.

quasar-loader

A webpack loader that intelligently generates imports and component declarations for components that are discovered in the template markup

Installation

npm install quasar-loader

Usage

import QuasarLoader from 'quasar-loader';
const loader = new QuasarLoader();

// This is a typical webpack plugin function which accepts the file contents and returns them back after doing transforms
const load = loader.load;

let exampleContents = 
  `<template>
    <q-list>
      <q-item
        v-for="something in somewhere">
        <q-btn>
          Useless Button
       </q-btn>
      </q-item>
    </q-list>
  </template>
  
  <script>
    import something from 'whatever';
    
    export default {
      components: {
        SomeUnrelatedThirdPartyComponent
      }
    };
  </script>`;
const result = load(exampleContents);
console.log(result);

/*

<template>
  <q-list>
    <q-item
      v-for="something in somewhere">
      <q-btn>
        Useless Button
     </q-btn>
    </q-item>
  </q-list>
</template>
  
<script>
  import {
    QList,
    QItem,
    QBtn
  } from 'quasar';
  
  import something from 'whatever';

  export default {
    components: {
      SomeUnrelatedThirdPartyComponent,
      QList,
      QItem,
      QBtn
    }
  };
</script>

*/

Current Tags

  • 0.1.2                                ...           latest (2 years ago)

3 Versions

  • 0.1.2                                ...           2 years ago
  • 0.1.1                                ...           2 years ago
  • 0.1.0                                ...           2 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 4
Dependencies (3)
Dependents (0)
None

Copyright 2014 - 2016 © taobao.org |