Webpack plugin to build vue files automatically
Are you having issues with editors when working on vue files? This is for you
Do you want to separate your vue
file? This is for you
You just don't like having the vue file? This is for you
You can use this plugin to automatically generate .vue
files.
$ npm install vue-builder-webpack-plugin --save-dev
In your webpack.config.js
var VueBuilder = require('vue-builder-webpack-plugin');
module.exports = {
// ...
plugins: [
new VueBuilder({
path: 'src'
})
]
};
Whenever you run webpack in normal or watch mode, this plugin will automatically generate your .vue
files.
If you have the following files, App.vue.js
, App.vue.css
, App.vue.html
, the generated App.vue
file will look like this:
<template src="./App.vue.html" lang="html"></template>
<script src="./App.vue.js" lang="js"></script>
<style src="./App.vue.css" lang="css"></style>
You can also rename the App.vue.css
to App.scoped.vue.css
to generate the following style
tag:
<style src="./App.scoped.vue.css" lang="css" scoped></style>
This plugin inherently supports jade
, coffee
, sass
, scss
, styl
, less
as languages in vue file.
path
: Either absolute path or the relative path to the main project folder. Used to search for building vue filesfolder
: Iftrue
, will support placing of individual files in a folder. Defaultfalse
(see below)allScoped
: Iftrue
, will default all style files to be scoped. EX:App.vue.css
would be considered asApp.scoped.vue.css
When you have the option folder
set to true
, you can place the files App.vue.js
, App.vue.css
, App.vue.html
inside a folder named
App
and the plugin will generate a file named App.vue
alongside the App
folder.
If you like this project, please watch this and follow me.
Here is a list of Contributors
I accept pull requests and guarantee a reply back within a day
MIT/X11
Report here. Guaranteed reply within a day.
Pavan Kumar Sunkara (pavan.sss1991@gmail.com)