1
0
mirror of https://github.com/chinchang/web-maker.git synced 2025-01-29 18:47:38 +01:00

move transpilers to transpilers folder

This commit is contained in:
Kushagra Gour 2018-01-13 13:02:04 +05:30
parent 7567c66707
commit 0c5943d652
12 changed files with 12 additions and 11 deletions

View File

@ -685,6 +685,7 @@ loginModal
* Loaded the code comiler based on the mode selected
*/
function handleModeRequirements(mode) {
const baseTranspilerPath = 'lib/transpilers';
// Exit if already loaded
var d = deferred();
if (modes[mode].hasLoaded) {
@ -698,26 +699,26 @@ loginModal
}
if (mode === HtmlModes.JADE) {
loadJS('lib/jade.js').then(setLoadedFlag);
loadJS(`${baseTranspilerPath}/jade.js`).then(setLoadedFlag);
} else if (mode === HtmlModes.MARKDOWN) {
loadJS('lib/marked.js').then(setLoadedFlag);
loadJS(`${baseTranspilerPath}/marked.js`).then(setLoadedFlag);
} else if (mode === CssModes.LESS) {
loadJS('lib/less.min.js').then(setLoadedFlag);
loadJS(`${baseTranspilerPath}/less.min.js`).then(setLoadedFlag);
} else if (mode === CssModes.SCSS || mode === CssModes.SASS) {
loadJS('lib/sass.js').then(function() {
sass = new Sass('lib/sass.worker.js');
loadJS(`${baseTranspilerPath}/sass.js`).then(function() {
sass = new Sass(`${baseTranspilerPath}/sass.worker.js`);
setLoadedFlag();
});
} else if (mode === CssModes.STYLUS) {
loadJS('lib/stylus.min.js').then(setLoadedFlag);
loadJS(`${baseTranspilerPath}/stylus.min.js`).then(setLoadedFlag);
} else if (mode === CssModes.ACSS) {
loadJS('lib/atomizer.browser.js').then(setLoadedFlag);
loadJS(`${baseTranspilerPath}/atomizer.browser.js`).then(setLoadedFlag);
} else if (mode === JsModes.COFFEESCRIPT) {
loadJS('lib/coffee-script.js').then(setLoadedFlag);
loadJS(`${baseTranspilerPath}/coffee-script.js`).then(setLoadedFlag);
} else if (mode === JsModes.ES6) {
loadJS('lib/babel.min.js').then(setLoadedFlag);
loadJS(`${baseTranspilerPath}/babel.min.js`).then(setLoadedFlag);
} else if (mode === JsModes.TS) {
loadJS('lib/typescript.js').then(setLoadedFlag);
loadJS(`${baseTranspilerPath}/typescript.js`).then(setLoadedFlag);
} else {
d.resolve();
}
@ -1032,7 +1033,7 @@ loginModal
if (jsMode === JsModes.ES6) {
contents +=
'<script src="' +
chrome.extension.getURL('lib/babel-polyfill.min.js') +
chrome.extension.getURL('lib/transpilers/babel-polyfill.min.js') +
'"></script>';
}