@omnia/tooling-vue
Version:
Used to bundle and serve manifests web component that build on Vue framework.
18 lines (17 loc) • 693 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.stylesheet = void 0;
const tslib_1 = require("tslib");
const base_1 = require("../base");
const $ = tslib_1.__importStar(require("../../../../variables"));
/** Transform stylesheet files */
exports.stylesheet = (0, base_1.defineTransformer)("stylesheet", () => {
return {
test(code, id) {
return id.endsWith('.css');
},
transform(code, id, fileGraph, ctx) {
return code.replace(new RegExp(`url('/${$.tooling.composer.getAssetsDir()}`.replace(/[.*+?^${}()|[\]\\]/g, '\\$&'), "g"), `url('https://localhost:${ctx.options.hosting.port}`);
}
};
});