This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Coercive / loose comparison | |
| if (5 == '5') { | |
| console.log('Coercion please!'); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const config = { | |
| app: { | |
| js: [ | |
| './src/scripts/**/*.js', | |
| ], | |
| scss: './src/style/**/*.scss', | |
| fonts: './src/fonts/*', | |
| images: './src/images/*.*', | |
| html: './src/*.html' | |
| }, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function cssTask(done) { | |
| src(config.app.scss) | |
| .pipe(sass({ outputStyle: 'expanded' })) | |
| .pipe(rename({ suffix: '.bundle' })) | |
| .pipe(postcss([autoprefixer(), cssnano()])) | |
| .pipe(dest(config.dist.base)) | |
| done(); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| exports.build = series(cleanUp, parallel(jsTask, cssTask, fontTask, imagesTask, templateTask)); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const { watch, src, dest, series, parallel } = require('gulp'); | |
| const browserSync = require('browser-sync').create(); | |
| const babel = require('gulp-babel'); | |
| const concat = require('gulp-concat'); | |
| const uglify = require('gulp-uglify'); | |
| const rename = require('gulp-rename'); | |
| const del = require('del'); | |
| const postcss = require('gulp-postcss'); | |
| const sass = require('gulp-sass'); | |
| const autoprefixer = require('autoprefixer'); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const { ApolloServer } = require('apollo-server'); | |
| // Import of the file where we define/fetch data | |
| const api = require('./server/api'); | |
| // Import of the file where we build data structures/schemas | |
| const typeDefs = require('./server/schema'); | |
| // Bind queries from schemas definition to data from API's | |
| const resolvers = { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Import of the file where we define/fetch data | |
| const api = require('./server/api'); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const api = { | |
| books: [ | |
| { | |
| title: 'Encyklopedia PWN - A-D', | |
| author: 'Instytut Przyszłości', | |
| }, | |
| { | |
| title: 'Encyklopedia PWN - E-G', | |
| author: 'Instytut Przyszłości', | |
| }, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Import of the file where we build data structures/schemas | |
| const typeDefs = require('./server/schema'); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const { gql } = require('apollo-server'); | |
| const typeDefs = gql` | |
| type Book { | |
| title: String | |
| author: String | |
| } | |
| type Country { | |
| name: String | |
| population: String |