UNPKG

@omni-door/tpl-spa-react

Version:

The React single-page-application project template

10 lines (9 loc) 3.16 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.tpl_omni = void 0; var utils_1 = require("@omni-door/utils"); var tpl = "`${use_strict}\n\nconst path = require('path');\nconst { merge } = require('webpack-merge');\n\nmodule.exports = {\n type: '${project_type}', // Project type; do not modify.\n\n dev: {\n webpack: () => require(path.resolve(__dirname, 'webpack.config.dev.js')), // Dev server webpack configuration.\n proxy: [\n // {\n // route: '/api',\n // config: {\n // target: 'http://www.api.com/api',\n // changeOrigin: true\n // }\n // }\n ], // Dev server proxy configuration.\n port: 6200, // Dev server port.\n // host: 'dev.domain.com', // Dev server host.\n // https: true, // Start dev server with HTTPS.\n devMiddlewareOptions: {\n headers: { 'Access-Control-Allow-Origin': '*' }\n }\n },\n\n build: {\n // Auto-release after a successful build.\n autoRelease: false,\n\n // Build source directory.\n // Must be an absolute path.\n srcDir: path.resolve(__dirname, '../src'),\n\n // Build output directory.\n // Must be an absolute path.\n outDir: path.resolve(__dirname, '../dist'),\n\n // Whether to add hashes to build assets: 'hash', 'contenthash', or 'chunkhash'.\n hash: true,\n\n // Build configuration callback.\n // Return a custom build configuration.\n configuration: config => merge(config, require(path.resolve(__dirname, 'webpack.config.prod.js'))),\n\n reserve: {\n assets: [] // Preserve additional asset paths in the build output.\n },\n\n preflight: {\n typescript: ${!!ts}, // Whether to process TS/TSX files during build.\n test: ${!!test}, // Whether to run unit tests during build.\n eslint: ${!!eslint}, // Whether to run ESLint during build.\n prettier: ${!!prettier}, // Whether to run Prettier during build.\n stylelint: ${!!stylelint}, // Whether to run Stylelint during build.\n }\n },\n\n release: {\n // Auto-build before release.\n autoBuild: false,\n\n // Git repository URL for release.\n git: '${git}',\n\n preflight: {\n test: ${!!test}, // Whether to run unit tests before release.\n eslint: ${!!eslint}, // Whether to run ESLint before release.\n prettier: ${!!prettier}, // Whether to run Prettier before release.\n stylelint: ${!!stylelint}, // Whether to run Stylelint before release.\n commitlint: ${!!commitlint}, // Whether to run Commitlint before release.\n branch: 'master' // Only allow release on this branch; set empty string to skip.\n }\n },\n\n template: {\n // Template root directory.\n // Must be an absolute path.\n root: path.resolve(__dirname, '../src/components'),\n\n // Whether to generate TypeScript files.\n typescript: ${!!ts},\n\n // Whether to generate unit test files.\n test: ${!!test},\n\n // Stylesheet type.\n stylesheet: '${style === 'all' ? 'scss' : style}'\n },\n\n plugins: []\n};\n`"; exports.tpl_omni = { tpl: tpl }; exports.default = utils_1.tplEngineInit(exports.tpl_omni, 'tpl');