Skip to content

Commit de88643

Browse files
author
Walker Leite
committed
fix(template): add missing dependencies and missing compilers file
1 parent 5d1e022 commit de88643

File tree

2 files changed

+40
-2
lines changed

2 files changed

+40
-2
lines changed

template/gulp-tasks/compilers.js

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
import path from 'path';
2+
import sass from 'vueify/lib/compilers/sass';
3+
import {dirs} from './config.js';
4+
5+
function replaceCuringas(content) {
6+
// FIXME: Not working
7+
const replacer = '@import "' + dirs.srcClient + '/$2";';
8+
9+
let replaced = content.replace(/@import.+(\@)(.*?)[\"\']/, replacer);
10+
replaced = content.replace(/@import.+(\~)(.*?)[\"\']/, replacer);
11+
return replaced;
12+
}
13+
14+
export function customSass(content, callback, compiler, filePath) {
15+
const relativePath = path.relative(
16+
path.dirname(filePath),
17+
path.resolve(dirs.srcClient, 'style/global.scss')
18+
);
19+
20+
// Global SCSS
21+
//
22+
content = '@import "' + relativePath + '";' + content;
23+
24+
content = replaceCuringas(content);
25+
26+
sass(
27+
content,
28+
callback,
29+
compiler,
30+
filePath
31+
);
32+
}

template/package.json

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@
4141
},
4242
"devDependencies": {
4343
"babel-core": "^6.25.0",
44-
"babel-polyfill": "^6.26.0",
4544
"babel-preset-es2015": "^6.24.1",
4645
"babelify": "^7.3.0",
4746
"browserify": "^14.4.0",
@@ -66,7 +65,14 @@
6665
"sinon": "^2.3.8",
6766
"vinyl-buffer": "^1.0.0",
6867
"vinyl-source-stream": "^1.1.0",
69-
"vueify": "^9.4.1"
68+
"vueify": "^9.4.1",
69+
"yargs": "^10.0.3",
70+
"babel-plugin-root-import": "^5.1.0",
71+
"connect-history-api-fallback": "^1.5.0",
72+
"node-sass": "^4.6.0",
73+
"nsp": "^2.1.0",
74+
"gulp-util": "^3.0.8",
75+
"babel-register": "^6.26.0"
7076
},
7177
"repository": {
7278
"type": "",

0 commit comments

Comments
 (0)