UNPKG

infrastructure-components

Version:

Infrastructure-Components configure the infrastructure of your React-App as part of your React-Components.

45 lines 1.25 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.getClientFilename = (name) => { return name + ".bundle.js"; }; exports.getServerFilename = (name) => { return name + ".js"; }; /** * transform a Client-Config to a Webpack-Client-Config * @param config */ exports.toClientWebpackConfig = (config, buildPath) => { return { entry: { app: config.entry }, output: { path: exports.getBuildPath(config, buildPath), filename: exports.getClientFilename(config.name) }, target: "web" }; }; exports.toServerWebpackConfig = (config, buildPath) => { // here we need to take care of multiple entries return { /*entry: { handler: config.entry },*/ entry: config.entry, output: { libraryTarget: "commonjs2", path: exports.getBuildPath(config, buildPath), filename: exports.getServerFilename(config.name), publicPath: '/' }, target: "node" }; }; exports.getBuildPath = (config, buildPath) => { const path = require('path'); return path.resolve(buildPath, config.name); }; //# sourceMappingURL=app-config.js.map