Skip to content

Instantly share code, notes, and snippets.

View colorincode's full-sized avatar

Kayla B colorincode

  • Color in code
View GitHub Profile
const { readFileSync, statSync, existsSync } = require('fs')
const mime = require('mime')
const CSSAsset = require(`parcel-bundler/${parseInt(process.versions.node, 10) < 8 ? 'lib' : 'src'}/assets/CSSAsset`)
const { dirname, join, resolve, extname, normalize, relative } = require('path')
const projectRootPath = resolve(__dirname, '../../../')
const parcelrcPath = join(projectRootPath, '.parcelrc')
const getConfig = () => existsSync(parcelrcPath) ? JSON.parse(readFileSync(parcelrcPath))['css-url-loader'] : {}
const EXTS = ['png', 'svg', 'jpg', 'gif', 'jpeg']