@nx-plugins/vite
Version:
The Nx Plugin for Vite that contains executors, generators, and utilities for managing Vite applications and libraries within an Nx workspace.
38 lines • 1.87 kB
JavaScript
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const tslib_1 = require("tslib");
const vite_1 = require("vite");
const devkit_1 = require("@nrwl/devkit");
function runExecutor(options) {
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
return tslib_1.__awaiter(this, void 0, void 0, function* () {
yield (0, vite_1.build)({
configFile: options.viteConfig,
server: {
base: options.base,
},
build: {
target: (_a = options.target) !== null && _a !== void 0 ? _a : 'modules',
outDir: (0, devkit_1.joinPathFragments)((_b = options.outDir) !== null && _b !== void 0 ? _b : 'dist/temp-vite'),
assetsDir: (_c = options.assetsDir) !== null && _c !== void 0 ? _c : 'assets',
assetsInlineLimit: (_d = options.assetsInlineLimit) !== null && _d !== void 0 ? _d : 4096,
ssr: options.ssr,
sourcemap: (_e = options.sourcemap) !== null && _e !== void 0 ? _e : false,
minify: (_f = options.minify) !== null && _f !== void 0 ? _f : 'esbuild',
manifest: (_g = options.manifest) !== null && _g !== void 0 ? _g : false,
ssrManifest: (_h = options.ssrManifest) !== null && _h !== void 0 ? _h : false,
},
optimizeDeps: {
force: options.force,
},
logLevel: (_j = options.logLevel) !== null && _j !== void 0 ? _j : "info",
clearScreen: (_k = options.clearScreen) !== null && _k !== void 0 ? _k : true,
mode: (_l = options.mode) !== null && _l !== void 0 ? _l : "production",
});
return {
success: true
};
});
}
exports.default = runExecutor;
//# sourceMappingURL=executor.js.map