Skip to content
This repository was archived by the owner on Jan 18, 2022. It is now read-only.

Commit ce97d60

Browse files
Carlos Fernándezznck
Carlos Fernández
authored andcommitted
Make optional dependencies really optional (#85)
* Make optional dependencies really optional * Update less.js Just to trigger CI build.
1 parent 51cbeae commit ce97d60

File tree

5 files changed

+6
-11
lines changed

5 files changed

+6
-11
lines changed

src/script/coffee.js

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
1-
import Compiler from 'coffeescript-compiler'
2-
3-
const coffee = new Compiler()
4-
51
export default function (script) {
2+
const Compiler = require('coffeescript-compiler')
3+
const coffee = new Compiler()
64
return new Promise((resolve, reject) => {
75
coffee.compile(script.code, { bare: true }, (status, output) => {
86
if (status === 0) {

src/style/less.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
1-
import less from 'less'
2-
31
export default async function (style, options) {
2+
const less = require('less')
43
const { css, map } = await less.render(style.code, {
54
sourceMap: {
65
sourceMapFullFilename: style.id,

src/style/scss.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
import sass from 'node-sass'
21
import debug from '../debug'
32

43
export default function (style, options) {
4+
const sass = require('node-sass')
55
debug(`SASS: ${style.id}`)
66
const { css, map } = sass.renderSync({
77
file: style.id,

src/style/stylus.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
1-
import stylus from 'stylus'
2-
31
export default async function (style, options) {
2+
const stylus = require('stylus')
43
const stylusObj = stylus(style.code, {...options.stylus})
54
.set('filename', style.id)
65
.set('sourcemap', {

src/template/pug.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
1-
import pug from 'pug'
2-
31
export default async function (template, extras, options) {
2+
const pug = require('pug')
43
const compiler = pug.compile(template, { filename: extras.id, ...options.pug })
54

65
return compiler({css: extras.modules || {}})

0 commit comments

Comments
 (0)