UNPKG

5.03 kBJavaScriptView Raw
1"use strict";
2Object.defineProperty(exports, "__esModule", { value: true });
3exports.tpl_omni = void 0;
4var utils_1 = require("@omni-door/utils");
5var tpl = "`${use_strict}\n\nconst path = require('path');\nconst { merge } = require('webpack-merge');\n\nmodule.exports = {\n type: '${project_type}', // \u9879\u76EE\u7C7B\u578B\uFF0C\u8BF7\u52FF\u4EFB\u610F\u53D8\u52A8 (project type, please don't modify)\n\n dev: {\n webpack: require(path.resolve(__dirname, 'webpack.config.dev.js')), // \u5F00\u53D1\u670D\u52A1\u7AEFwebpack\u914D\u7F6E (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 ], // \u5F00\u53D1\u670D\u52A1\u4EE3\u7406\u914D\u7F6E (dev-server proxy config)\n port: 6200, // \u5F00\u53D1\u670D\u52A1\u7AEF\u53E3\u53F7 (dev-server port)\n // host: 'dev.domain.com', // \u5F00\u53D1\u670D\u52A1\u7AEFhost (dev-server host)\n // https: true, // \u4EE5https\u534F\u8BAE\u542F\u52A8\u5F00\u53D1\u670D\u52A1 (start dev-server with https)\n devMiddlewareOptions: {\n headers: { 'Access-Control-Allow-Origin': '*' }\n }\n },\n\n build: {\n // \u6784\u5EFA\u5B8C\u6210\u540E\u662F\u5426\u81EA\u52A8\u53D1\u5E03 (auto release project after build success)\n autoRelease: false,\n\n // \u8F93\u5165\u8DEF\u5F84 (the build source directory)\n // \u52A1\u5FC5\u4F7F\u7528\u7EDD\u5BF9\u8DEF\u5F84 (must be a absolute path)\n srcDir: path.resolve(__dirname, '../src'),\n\n // \u8F93\u51FA\u8DEF\u5F84 (the directory for compiled project)\n // \u52A1\u5FC5\u4F7F\u7528\u7EDD\u5BF9\u8DEF\u5F84 (must be a absolute path)\n outDir: path.resolve(__dirname, '../dist'),\n\n // \u6784\u5EFA\u7684\u8D44\u6E90\u662F\u5426\u52A0\u4E0Ahash\uFF0C\u53EF\u9009 'hash'\u3001'contenthash'\u3001'chunkhash' (whether the hash tag add to building result)\n hash: true,\n\n // \u6784\u5EFA\u9636\u6BB5\u7684\u81EA\u5B9A\u4E49\u914D\u7F6E\u56DE\u8C03 (The callback will be call in the build-process)\n // \u8FD4\u56DE\u81EA\u5B9A\u4E49\u7684\u914D\u7F6E (You can return your custom build configuration)\n configuration: config => merge(config, require(path.resolve(__dirname, 'webpack.config.prod.js'))),\n\n reserve: {\n assets: [] // \u6784\u5EFA\u7ED3\u679C\u4FDD\u7559\u5176\u4ED6\u8D44\u6E90\u7684\u8DEF\u5F84 (reserve other asset paths)\n },\n\n preflight: {\n typescript: ${!!ts}, // \u6784\u5EFA\u65F6\u662F\u5426\u5904\u7406ts\u6216tsx\u6587\u4EF6 (whether or not process the ts or tsx files)\n test: ${!!test}, // \u6784\u5EFA\u65F6\u662F\u5426\u8FDB\u884C\u5355\u5143\u6D4B\u8BD5 (whether or not process unit-test)\n eslint: ${!!eslint}, // \u6784\u5EFA\u65F6\u662F\u5426\u8FDB\u884Ceslint\u68C0\u6D4B (whether or not process eslint checking)\n prettier: ${!!prettier}, // \u6784\u5EFA\u65F6\u662F\u5426\u8FDB\u884Cprettier\u68C0\u6D4B (whether or not process prettier checking)\n stylelint: ${!!stylelint}, // \u6784\u5EFA\u65F6\u662F\u5426\u8FDB\u884Cstylelint\u68C0\u6D4B (whether or not process stylelint checking)\n }\n },\n\n release: {\n git: '${git}', // \u53D1\u5E03\u7684git\u4ED3\u5E93\u5730\u5740 (project git repo url)\n preflight: {\n test: ${!!test}, // \u53D1\u5E03\u524D\u662F\u5426\u8FDB\u884C\u5355\u5143\u6D4B\u8BD5 (whether or not process unit-test)\n eslint: ${!!eslint}, // \u53D1\u5E03\u524D\u662F\u5426\u8FDB\u884Ceslint\u68C0\u6D4B (whether or not process eslint checking)\n prettier: ${!!prettier}, // \u53D1\u5E03\u524D\u662F\u5426\u8FDB\u884Cprettier\u68C0\u6D4B (whether or not process prettier checking)\n stylelint: ${!!stylelint}, // \u53D1\u5E03\u524D\u662F\u5426\u8FDB\u884Cstylelint\u68C0\u6D4B (whether or not process stylelint checking)\n commitlint: ${!!commitlint}, // \u53D1\u5E03\u524D\u662F\u5426\u8FDB\u884Ccommitlint\u68C0\u6D4B (whether or not process commitlint checking)\n branch: 'master' // \u53D1\u5E03\u524D\u8FDB\u884C\u5206\u652F\u68C0\u6D4B\uFF0C\u8BBE\u7F6E\u4E3A\u7A7A\u5B57\u7B26\u4E32\u5219\u4E0D\u4F1A\u68C0\u6D4B (only can release in this branch, set empty string to ignore this check)\n }\n },\n\n template: {\n // \u751F\u6210\u6A21\u677F\u7684\u6839\u8DEF\u5F84 (the root directory for generate template)\n // \u52A1\u5FC5\u4F7F\u7528\u7EDD\u5BF9\u8DEF\u5F84 (must be a absolute path)\n root: path.resolve(__dirname, '../src/components'),\n\n // \u662F\u5426\u521B\u5EFAts\u6587\u4EF6 (whether or not generate typescript)\n typescript: ${!!ts},\n\n // \u662F\u5426\u521B\u5EFA\u5355\u5143\u6D4B\u8BD5\u6587\u4EF6 (whether or not generate unit test frame)\n test: ${!!test},\n\n // \u6837\u5F0F\u6587\u4EF6\u7C7B\u578B (stylesheet type)\n stylesheet: '${style === 'all' ? 'scss' : style}'\n },\n\n plugins: []\n};\n`";
6exports.tpl_omni = {
7 tpl: tpl
8};
9exports.default = utils_1.tplEngineInit(exports.tpl_omni, 'tpl');