This package has been deprecated

Author message:

This package has been deprecated.

vue-composite-loader

1.0.3 • Public • Published

vue-composite-loader Build Status

A webpack loader for transforming .vue files into .js Vue composable components. Vue-composite-loader works in tandem with vue-loader to allow you to easily share your Vue components across services with the vue-composite plugin.

Installation

npm i --save-dev vue-composite-loader

Getting Started

Vue-composite-loader is intended to be used in tandem with vue-loader, generating self-executing JS modules from .vue files. The JS modules can be requested by other Vue applications using the vue-composite plugin.

  1. Once installed, add vue-composite-loader to your webpack.config.js file:
// Webpack > 2.0.x
module.exports = {
  module: {
    rules: [
      // ...
      {
        test: /\.vue$/,
        use: [
          {
            loader: 'vue-loader',
          },
          {
            loader: 'vue-composite-loader',
            options: {
              path: path.resolve(__dirname, 'path/to/output/'),
            },
          },
        ],
      }
    ]
  }
},
  1. Run webpack.
  2. Compose your Vue applications by sharing links to the js modules with vue-composite.

Example

Input

<template>
  <div class="app">{{msg}}</div>
</template>
 
<script>
  export default {
    name: 'app',
    data() {
      return {
        msg: 'Hello Vue!',
      };
    },
  };
</script> 
 
<style>
.app {
  background-color: #eee;
}
</style> 

Output

(function() {
    return{
    name: 'app',
    data() {
      return {
        msg: 'Hello Vue!',
      };
    },
    template: `<div class="app">{{msg}}</div>`,
    _injectCss: `.app {
      background-color: #eee;
    }`,
};
})();

Limitations

Currently, vue-composite-loader does not support any template or style pre-processors such as Jade or Sass. These are planned enhancements.

Development Setup

npm install
npm lint
npm run test

Package Sidebar

Install

npm i vue-composite-loader

Weekly Downloads

0

Version

1.0.3

License

ISC

Last publish

Collaborators

  • auzmartist