Skip to content

Commit

Permalink
Import external libraries with tilde (#23)
Browse files Browse the repository at this point in the history
  • Loading branch information
BafS committed Feb 20, 2020
1 parent 95647b0 commit 8c8cc38
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 4 deletions.
8 changes: 6 additions & 2 deletions gulpfile.js
Original file line number Diff line number Diff line change
@@ -1,17 +1,21 @@
const { watch, series, src, dest } = require('gulp');
const rename = require('gulp-rename');
const sass = require('gulp-sass');
const tildeImporter = require('node-sass-tilde-importer');

const buildCss = () => {
return src('scss/**/*.scss')
.pipe(sass().on('error', sass.logError))
.pipe(sass({
importer: tildeImporter,
}).on('error', sass.logError))
.pipe(dest('dist'));
};

const minifyCss = () => {
return src('scss/**/*.scss')
.pipe(sass({
outputStyle: 'compressed'
importer: tildeImporter,
outputStyle: 'compressed',
}).on('error', sass.logError))
.pipe(rename({
suffix: '.min'
Expand Down
15 changes: 15 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@
"devDependencies": {
"gulp": "^4.0.0",
"gulp-rename": "^2.0.0",
"gulp-sass": "^4.0.2"
"gulp-sass": "^4.0.2",
"node-sass-tilde-importer": "^1.0.2"
},
"eyeglass": {
"name": "gutenberg",
Expand Down
2 changes: 1 addition & 1 deletion scss/gutenberg.scss
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
@import 'variables';

// Normalize
@import '../node_modules/normalize.css/normalize';
@import '~normalize.css/normalize';

@import 'print-reset';
@import 'pagination';
Expand Down

0 comments on commit 8c8cc38

Please sign in to comment.