Skip to content

Commit dcab93a

Browse files
author
Guillaume Chau
committed
Updated language packages to support src
1 parent 5f473af commit dcab93a

File tree

5 files changed

+12
-8
lines changed

5 files changed

+12
-8
lines changed

packages/vue-jade/vue-jade.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@ global.vue.lang = global.vue.lang || {}
44
import jade from 'jade';
55
import { Meteor } from 'meteor/meteor';
66

7-
global.vue.lang.jade = Meteor.wrapAsync(function({ source, inputFile }, cb) {
7+
global.vue.lang.jade = Meteor.wrapAsync(function({ source, basePath, inputFile }, cb) {
88
var fn = jade.compile(source, {
9-
filename: inputFile.getPathInPackage(),
9+
filename: basePath,
1010
fileMode: true
1111
});
1212

packages/vue-less/vue-less.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,10 +103,11 @@ function getImportPlugin(inputFile, dependencyManager) {
103103
global.vue.lang.less = Meteor.wrapAsync(function({
104104
source,
105105
inputFile,
106+
basePath,
106107
dependencyManager
107108
}, cb) {
108109
less.render(source, {
109-
filename: inputFile.getPathInPackage(),
110+
filename: basePath,
110111
plugins: [getImportPlugin(inputFile, dependencyManager)],
111112
sourceMap: {
112113
outputSourceFiles: true

packages/vue-pug/vue-pug.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@ global.vue.lang = global.vue.lang || {}
44
import pug from 'pug';
55
import { Meteor } from 'meteor/meteor';
66

7-
global.vue.lang.pug = Meteor.wrapAsync(function({ source, inputFile }, cb) {
7+
global.vue.lang.pug = Meteor.wrapAsync(function({ source, basePath, inputFile }, cb) {
88
var fn = pug.compile(source, {
9-
filename: inputFile.getPathInPackage(),
9+
filename: basePath,
1010
fileMode: true
1111
});
1212

packages/vue-sass/vue-sass.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ function decodeFilePath(filePath) {
6767

6868
global.vue.lang.scss = Meteor.wrapAsync(function({
6969
source,
70+
basePath,
7071
inputFile,
7172
dependencyManager
7273
}, cb) {
@@ -94,6 +95,7 @@ global.vue.lang.scss = Meteor.wrapAsync(function({
9495

9596
global.vue.lang.sass = Meteor.wrapAsync(function({
9697
source,
98+
basePath,
9799
inputFile,
98100
dependencyManager
99101
}, cb) {
@@ -104,7 +106,7 @@ global.vue.lang.sass = Meteor.wrapAsync(function({
104106
sass.render({
105107
data: source,
106108
importer: resolveImport(dependencyManager),
107-
outFile: inputFile.getPathInPackage() + '.css',
109+
outFile: basePath + '.css',
108110
sourceMap: true,
109111
sourceMapContents: true,
110112
indentedSyntax: true

packages/vue-stylus/vue-stylus.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ function statOrNull(path) {
1717

1818
global.vue.lang.stylus = Meteor.wrapAsync(function({
1919
source,
20+
basePath,
2021
inputFile,
2122
dependencyManager
2223
}, cb) {
@@ -28,7 +29,7 @@ global.vue.lang.stylus = Meteor.wrapAsync(function({
2829
/*} else if (filename.indexOf('{') === 0) {
2930
resolvedFilename = decodeFilePath(filename);*/
3031
} else {
31-
let currentDirectory = path.dirname(inputFile.getPathInPackage());
32+
let currentDirectory = path.dirname(basePath);
3233
resolvedFilename = path.resolve(currentDirectory, filePath);
3334
}
3435

@@ -72,7 +73,7 @@ global.vue.lang.stylus = Meteor.wrapAsync(function({
7273

7374
let style = stylus(source)
7475
.use(nib())
75-
.set('filename', inputFile.getPathInPackage())
76+
.set('filename', basePath)
7677
.set('sourcemap', { inline: false, comment: false })
7778
.set('cache', true)
7879
.set('importer', importer);

0 commit comments

Comments
 (0)