This repository has been archived on 2023-03-18. You can view files and clone it, but cannot push or open issues or pull requests.
osr-discourse-src/app/assets/javascripts/discourse/lib/pretty-text-engine.js
Robin Ward 5b02aad9c1
Support for Testem in Ember CLI (#12442)
* DEV: Use custom tags rather than handlebars server side

These will be skipped if they are ever rendered in a document. The
handlebars really messes stuff up.

* DEV: Build our own locale file for testing purposes

We can't practically proxy everything in test mode, but we can
approximate the logic and build our own locale file for testing purposes
that works quite well. This allows us to run tests without a proxy.

* DEV: Support for testem runner for ember cli tests
2021-03-19 09:32:46 -04:00

22 lines
702 B
JavaScript

const babel = require("broccoli-babel-transpiler");
const mergeTrees = require("broccoli-merge-trees");
const funnel = require("broccoli-funnel");
const path = require("path");
const concat = require("broccoli-concat");
module.exports = function prettyTextEngine(vendorJs, engine) {
let engineTree = babel(`../pretty-text/engines/${engine}`, {
plugins: ["@babel/plugin-transform-modules-amd"],
moduleIds: true,
getModuleId(name) {
return `pretty-text/engines/${engine}/${path.basename(name)}`;
},
});
let markdownIt = funnel(vendorJs, { files: ["markdown-it.js"] });
return concat(mergeTrees([engineTree, markdownIt]), {
outputFile: `assets/${engine}.js`,
});
};