Skip to content

Commit 9cb4910

Browse files
author
young
committed
Fix require path problem and improve the docs
1 parent d177ed9 commit 9cb4910

File tree

3 files changed

+69
-3
lines changed

3 files changed

+69
-3
lines changed

README.md

Lines changed: 67 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,68 @@
11
# laravel-elixir-vue-loader
2-
Laravel Elixir Vue-loader Extension
2+
3+
Simple extension to laravel elixir for building vue single page application depend on vue-loader.
4+
5+
[![NPM](https://nodei.co/npm/laravel-elixir-vue-loader.png?downloads=true&downloadRank=true&stars=true)](https://nodei.co/npm/laravel-elixir-vue-loader/)
6+
7+
## Install
8+
9+
```
10+
npm install --save-dev laravel-elixir-vue-loader
11+
```
12+
13+
## Usage
14+
15+
### Basic Example
16+
17+
Within your main Gulpfile, add:
18+
19+
```javascript
20+
var elixir = require('laravel-elixir');
21+
22+
require('laravel-elixir-vue-loader');
23+
24+
elixir(function(mix) {
25+
mix.vue('app.js');
26+
});
27+
```
28+
### Watching Assets For Changes
29+
30+
Just run:
31+
```
32+
gulp watch
33+
```
34+
Any change of your entry file or your Vue components "*.vue" will automatically be compiled.Cool,hah?
35+
36+
### Custom Webpack Config
37+
38+
Also you can pass your custom webpack config to the second argument of the vue function.
39+
For example,you want to use sass in your app,you can do this:
40+
41+
```javascript
42+
elixir(function(mix) {
43+
mix.vue('app.js', {
44+
module: {
45+
loaders: [
46+
{test: /\.scss$/, loader: 'style!css!autoprefixer!sass'},
47+
],
48+
},
49+
});
50+
});
51+
```
52+
Definitely you need to install the sass loader first.
53+
54+
This extension also support webpack.config.js.Just put your webpack.config.js in laravel app root path.It works :)
55+
56+
###Setting an output file
57+
58+
```javascript
59+
elixir(function(mix) {
60+
mix.vue('app.js', {}, './your-public-path/app.js');
61+
});
62+
```
63+
64+
## Issues
65+
66+
Feel free to report bugs or suggestions on issue page.
67+
68+
##Let The Code Fly ~

index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ var handleWebpackConfig = function (webpackConfig, paths) {
7777
};
7878

7979
if (fs.existsSync('webpack.config.js')) {
80-
var customWebpackConfig = require('./webpack.config.js');
80+
var customWebpackConfig = require('./../../webpack.config.js');
8181
defaultWebpackConfig = _.extend(defaultWebpackConfig, customWebpackConfig);
8282
}
8383

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "laravel-elixir-vue-loader",
3-
"version": "1.0.0",
3+
"version": "1.0.1",
44
"description": "Laravel Elixir Vue-loader Extension",
55
"main": "index.js",
66
"scripts": {

0 commit comments

Comments
 (0)