fix require in the only way I know that works at runtime

This commit is contained in:
Peter van der Woude
2018-06-23 19:59:36 +10:00
parent 5ce60d33ad
commit 4a27679e25
2 changed files with 3 additions and 2 deletions
+1
View File
@@ -2,6 +2,7 @@
// Project: https://github.com/jotform/css.js
// Definitions by: Peter van der Woude <https://github.com/pandawood>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
/// <reference types="node" />
/**
+2 -2
View File
@@ -1,10 +1,10 @@
import cssjsGlobal = require("../jotform-css.js")
let cssjsGlobal = require("jotform-css.js")
import { CssJs } from "./index"
// not all interface methods tested here, below is a sample of code that I've actually used
class TestParser {
public parse(cssString: string): string {
const parser = new (<any>cssjsGlobal).cssjs() as CssJs
const parser = new cssjsGlobal.cssjs() as CssJs
let parsed = parser.parseCSS(cssString)
parsed = parser.applyNamespacing(parsed, "#id1")