Last active
November 18, 2019 17:05
Revisions
-
c0bra revised this gist
Jan 3, 2019 . 1 changed file with 1 addition and 8 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -17,14 +17,7 @@ function compile(filePath, name) { const { input, output } = generateOptions(filePath, name); return rollup.rollup(input) .then(bundle => bundle.generate(output)); } module.exports = { compile }; -
c0bra revised this gist
Jan 3, 2019 . 2 changed files with 34 additions and 0 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,20 @@ { "jest": { "testMatch": [ "**/test/**/*.js" ], "transform": { "\\.js$": "babel-jest", "\\.(html|svelte)$": "./test/transform" }, "transformIgnorePatterns": [ "/node_modules/(?!svelte).+\\.js$" ], "moduleFileExtensions": [ "js", "json", "html", "svelte" ] } } 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,14 @@ const deasync = require('deasync'); const { compile } = require('./compile'); module.exports.process = (_s, filePath, _c, _o) => { let code, map; compile(filePath, 'App', {}).then(comp => { code = comp.code; map = comp.map; }); deasync.loopWhile(() => !code && !map); return { code, map }; }; -
c0bra created this gist
Jan 3, 2019 .There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,30 @@ const rollup = require('rollup'); const esm = require('esm'); const { config } = esm(module)('../rollup.config'); function generateOptions(filePath, name) { return { input: { input: filePath, plugins: config.plugins }, output: { file: `./dist/test/${name}.js`, format: 'cjs', }, }; } function compile(filePath, name) { const { input, output } = generateOptions(filePath, name); return rollup.rollup(input) .then(bundle => { return bundle.generate(output); }) .then(({ code, map }) => { console.log('CODE', code); return { code, map }; }); } module.exports = { compile };