@nx/vite 16.0.0-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +8 -0
- package/LICENSE +22 -0
- package/README.md +63 -0
- package/executors.d.ts +8 -0
- package/executors.js +19 -0
- package/executors.js.map +1 -0
- package/executors.json +46 -0
- package/generators.json +46 -0
- package/index.d.ts +8 -0
- package/index.js +20 -0
- package/index.js.map +1 -0
- package/migrations.json +80 -0
- package/package.json +60 -0
- package/plugins/rollup-replace-files.plugin.d.ts +16 -0
- package/plugins/rollup-replace-files.plugin.js +49 -0
- package/plugins/rollup-replace-files.plugin.js.map +1 -0
- package/src/executors/build/build.impl.d.ts +10 -0
- package/src/executors/build/build.impl.js +91 -0
- package/src/executors/build/build.impl.js.map +1 -0
- package/src/executors/build/compat.d.ts +2 -0
- package/src/executors/build/compat.js +10 -0
- package/src/executors/build/compat.js.map +1 -0
- package/src/executors/build/schema.d.js +3 -0
- package/src/executors/build/schema.d.js.map +1 -0
- package/src/executors/build/schema.d.ts +17 -0
- package/src/executors/build/schema.json +143 -0
- package/src/executors/dev-server/compat.d.ts +2 -0
- package/src/executors/dev-server/compat.js +10 -0
- package/src/executors/dev-server/compat.js.map +1 -0
- package/src/executors/dev-server/dev-server.impl.d.ts +8 -0
- package/src/executors/dev-server/dev-server.impl.js +68 -0
- package/src/executors/dev-server/dev-server.impl.js.map +1 -0
- package/src/executors/dev-server/schema.d.js +3 -0
- package/src/executors/dev-server/schema.d.js.map +1 -0
- package/src/executors/dev-server/schema.d.ts +14 -0
- package/src/executors/dev-server/schema.json +89 -0
- package/src/executors/preview-server/compat.d.ts +2 -0
- package/src/executors/preview-server/compat.js +10 -0
- package/src/executors/preview-server/compat.js.map +1 -0
- package/src/executors/preview-server/preview-server.impl.d.ts +7 -0
- package/src/executors/preview-server/preview-server.impl.js +107 -0
- package/src/executors/preview-server/preview-server.impl.js.map +1 -0
- package/src/executors/preview-server/schema.d.js +3 -0
- package/src/executors/preview-server/schema.d.js.map +1 -0
- package/src/executors/preview-server/schema.d.ts +12 -0
- package/src/executors/preview-server/schema.json +80 -0
- package/src/executors/test/compat.d.ts +2 -0
- package/src/executors/test/compat.js +10 -0
- package/src/executors/test/compat.js.map +1 -0
- package/src/executors/test/schema.d.js +3 -0
- package/src/executors/test/schema.d.js.map +1 -0
- package/src/executors/test/schema.d.ts +11 -0
- package/src/executors/test/schema.json +63 -0
- package/src/executors/test/vitest.impl.d.ts +6 -0
- package/src/executors/test/vitest.impl.js +130 -0
- package/src/executors/test/vitest.impl.js.map +1 -0
- package/src/generators/configuration/configuration.d.ts +5 -0
- package/src/generators/configuration/configuration.js +130 -0
- package/src/generators/configuration/configuration.js.map +1 -0
- package/src/generators/configuration/schema.d.js +3 -0
- package/src/generators/configuration/schema.d.js.map +1 -0
- package/src/generators/configuration/schema.d.ts +12 -0
- package/src/generators/configuration/schema.json +61 -0
- package/src/generators/init/init.d.ts +6 -0
- package/src/generators/init/init.js +84 -0
- package/src/generators/init/init.js.map +1 -0
- package/src/generators/init/schema.d.js +3 -0
- package/src/generators/init/schema.d.js.map +1 -0
- package/src/generators/init/schema.d.ts +4 -0
- package/src/generators/init/schema.json +22 -0
- package/src/generators/vitest/files/tsconfig.spec.json__tmpl__ +19 -0
- package/src/generators/vitest/schema.d.js +3 -0
- package/src/generators/vitest/schema.d.js.map +1 -0
- package/src/generators/vitest/schema.d.ts +9 -0
- package/src/generators/vitest/schema.json +49 -0
- package/src/generators/vitest/vitest-generator.d.ts +5 -0
- package/src/generators/vitest/vitest-generator.js +99 -0
- package/src/generators/vitest/vitest-generator.js.map +1 -0
- package/src/migrations/update-15-3-1/update-vite-tsconfig-paths.d.ts +3 -0
- package/src/migrations/update-15-3-1/update-vite-tsconfig-paths.js +63 -0
- package/src/migrations/update-15-3-1/update-vite-tsconfig-paths.js.map +1 -0
- package/src/migrations/update-15-3-4/set-mode-in-configuration.d.ts +3 -0
- package/src/migrations/update-15-3-4/set-mode-in-configuration.js +33 -0
- package/src/migrations/update-15-3-4/set-mode-in-configuration.js.map +1 -0
- package/src/migrations/update-15-4-3/update-report-directory.d.ts +3 -0
- package/src/migrations/update-15-4-3/update-report-directory.js +35 -0
- package/src/migrations/update-15-4-3/update-report-directory.js.map +1 -0
- package/src/migrations/update-16-0-0-add-nx-packages/update-16-0-0-add-nx-packages.d.ts +2 -0
- package/src/migrations/update-16-0-0-add-nx-packages/update-16-0-0-add-nx-packages.js +13 -0
- package/src/migrations/update-16-0-0-add-nx-packages/update-16-0-0-add-nx-packages.js.map +1 -0
- package/src/utils/generator-utils.d.ts +34 -0
- package/src/utils/generator-utils.js +567 -0
- package/src/utils/generator-utils.js.map +1 -0
- package/src/utils/options-utils.d.ts +32 -0
- package/src/utils/options-utils.js +113 -0
- package/src/utils/options-utils.js.map +1 -0
- package/src/utils/test-files/angular-project.config.json +89 -0
- package/src/utils/test-files/react-lib-non-buildable-jest.json +25 -0
- package/src/utils/test-files/react-lib-non-buildable-vitest.json +25 -0
- package/src/utils/test-files/react-mixed-project.config.json +52 -0
- package/src/utils/test-files/react-project.config.json +85 -0
- package/src/utils/test-files/react-vite-project.config.json +57 -0
- package/src/utils/test-files/test-vite-configs.d.ts +32 -0
- package/src/utils/test-files/test-vite-configs.js +285 -0
- package/src/utils/test-files/test-vite-configs.js.map +1 -0
- package/src/utils/test-files/unknown-project.config.json +72 -0
- package/src/utils/test-files/web-project.config.json +72 -0
- package/src/utils/test-utils.d.ts +9 -0
- package/src/utils/test-utils.js +516 -0
- package/src/utils/test-utils.js.map +1 -0
- package/src/utils/versions.d.ts +13 -0
- package/src/utils/versions.js +37 -0
- package/src/utils/versions.js.map +1 -0
- package/src/utils/vite-config-edit-utils.d.ts +3 -0
- package/src/utils/vite-config-edit-utils.js +286 -0
- package/src/utils/vite-config-edit-utils.js.map +1 -0
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { ExecutorContext } from '@nx/devkit';
|
|
2
|
+
import { BuildOptions, InlineConfig, PreviewOptions, ServerOptions } from 'vite';
|
|
3
|
+
import { ViteDevServerExecutorOptions } from '../executors/dev-server/schema';
|
|
4
|
+
import { VitePreviewServerExecutorOptions } from '../executors/preview-server/schema';
|
|
5
|
+
import { ViteBuildExecutorOptions } from '../executors/build/schema';
|
|
6
|
+
/**
|
|
7
|
+
* Returns the path to the vite config file or undefined when not found.
|
|
8
|
+
*/
|
|
9
|
+
export declare function normalizeViteConfigFilePath(projectRoot: string, configFile?: string): string | undefined;
|
|
10
|
+
/**
|
|
11
|
+
* Returns the path to the proxy configuration file or undefined when not found.
|
|
12
|
+
*/
|
|
13
|
+
export declare function getViteServerProxyConfigPath(nxProxyConfig: string | undefined, context: ExecutorContext): string | undefined;
|
|
14
|
+
/**
|
|
15
|
+
* Builds the shared options for vite.
|
|
16
|
+
*
|
|
17
|
+
* Most shared options are derived from the build target.
|
|
18
|
+
*/
|
|
19
|
+
export declare function getViteSharedConfig(options: ViteBuildExecutorOptions, clearScreen: boolean | undefined, context: ExecutorContext): InlineConfig;
|
|
20
|
+
/**
|
|
21
|
+
* Builds the options for the vite dev server.
|
|
22
|
+
*/
|
|
23
|
+
export declare function getViteServerOptions(options: ViteDevServerExecutorOptions, context: ExecutorContext): ServerOptions;
|
|
24
|
+
/**
|
|
25
|
+
* Builds the build options for the vite.
|
|
26
|
+
*/
|
|
27
|
+
export declare function getViteBuildOptions(options: ViteBuildExecutorOptions, context: ExecutorContext): BuildOptions;
|
|
28
|
+
/**
|
|
29
|
+
* Builds the options for the vite preview server.
|
|
30
|
+
*/
|
|
31
|
+
export declare function getVitePreviewOptions(options: VitePreviewServerExecutorOptions, context: ExecutorContext): PreviewOptions;
|
|
32
|
+
export declare function getNxTargetOptions(target: string, context: ExecutorContext): any;
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
function _export(target, all) {
|
|
3
|
+
for(var name in all)Object.defineProperty(target, name, {
|
|
4
|
+
enumerable: true,
|
|
5
|
+
get: all[name]
|
|
6
|
+
});
|
|
7
|
+
}
|
|
8
|
+
_export(exports, {
|
|
9
|
+
normalizeViteConfigFilePath: ()=>normalizeViteConfigFilePath,
|
|
10
|
+
getViteServerProxyConfigPath: ()=>getViteServerProxyConfigPath,
|
|
11
|
+
getViteSharedConfig: ()=>getViteSharedConfig,
|
|
12
|
+
getViteServerOptions: ()=>getViteServerOptions,
|
|
13
|
+
getViteBuildOptions: ()=>getViteBuildOptions,
|
|
14
|
+
getVitePreviewOptions: ()=>getVitePreviewOptions,
|
|
15
|
+
getNxTargetOptions: ()=>getNxTargetOptions
|
|
16
|
+
});
|
|
17
|
+
const _devkit = require("@nx/devkit");
|
|
18
|
+
const _fs = require("fs");
|
|
19
|
+
const _path = require("path");
|
|
20
|
+
const _vite = require("vite");
|
|
21
|
+
const _rollupReplaceFilesPlugin = require("../../plugins/rollup-replace-files.plugin");
|
|
22
|
+
function normalizeViteConfigFilePath(projectRoot, configFile) {
|
|
23
|
+
return configFile && (0, _fs.existsSync)((0, _devkit.joinPathFragments)(configFile)) ? configFile : (0, _fs.existsSync)((0, _devkit.joinPathFragments)(`${projectRoot}/vite.config.ts`)) ? (0, _devkit.joinPathFragments)(`${projectRoot}/vite.config.ts`) : (0, _fs.existsSync)((0, _devkit.joinPathFragments)(`${projectRoot}/vite.config.js`)) ? (0, _devkit.joinPathFragments)(`${projectRoot}/vite.config.js`) : undefined;
|
|
24
|
+
}
|
|
25
|
+
function getViteServerProxyConfigPath(nxProxyConfig, context) {
|
|
26
|
+
if (nxProxyConfig) {
|
|
27
|
+
const projectRoot = context.projectsConfigurations.projects[context.projectName].root;
|
|
28
|
+
const proxyConfigPath = nxProxyConfig ? (0, _path.join)(context.root, nxProxyConfig) : (0, _path.join)(projectRoot, 'proxy.conf.json');
|
|
29
|
+
if ((0, _fs.existsSync)(proxyConfigPath)) {
|
|
30
|
+
return proxyConfigPath;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
function getViteSharedConfig(options, clearScreen, context) {
|
|
35
|
+
const projectRoot = context.projectsConfigurations.projects[context.projectName].root;
|
|
36
|
+
const root = _path.relative(context.cwd, (0, _devkit.joinPathFragments)(context.root, projectRoot));
|
|
37
|
+
return {
|
|
38
|
+
mode: options.mode,
|
|
39
|
+
root,
|
|
40
|
+
base: options.base,
|
|
41
|
+
configFile: normalizeViteConfigFilePath(projectRoot, options.configFile),
|
|
42
|
+
plugins: [
|
|
43
|
+
(0, _rollupReplaceFilesPlugin.default)(options.fileReplacements)
|
|
44
|
+
],
|
|
45
|
+
optimizeDeps: {
|
|
46
|
+
force: options.force
|
|
47
|
+
},
|
|
48
|
+
clearScreen: clearScreen,
|
|
49
|
+
logLevel: options.logLevel
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
function getViteServerOptions(options, context) {
|
|
53
|
+
const projectRoot = context.projectsConfigurations.projects[context.projectName].root;
|
|
54
|
+
const serverOptions = {
|
|
55
|
+
host: options.host,
|
|
56
|
+
port: options.port,
|
|
57
|
+
https: options.https,
|
|
58
|
+
hmr: options.hmr,
|
|
59
|
+
open: options.open,
|
|
60
|
+
cors: options.cors,
|
|
61
|
+
fs: {
|
|
62
|
+
allow: [
|
|
63
|
+
(0, _vite.searchForWorkspaceRoot)((0, _devkit.joinPathFragments)(projectRoot)),
|
|
64
|
+
(0, _devkit.joinPathFragments)(context.root, 'node_modules/vite')
|
|
65
|
+
]
|
|
66
|
+
}
|
|
67
|
+
};
|
|
68
|
+
const proxyConfigPath = getViteServerProxyConfigPath(options.proxyConfig, context);
|
|
69
|
+
if (proxyConfigPath) {
|
|
70
|
+
_devkit.logger.info(`Loading proxy configuration from: ${proxyConfigPath}`);
|
|
71
|
+
serverOptions.proxy = require(proxyConfigPath);
|
|
72
|
+
}
|
|
73
|
+
return serverOptions;
|
|
74
|
+
}
|
|
75
|
+
function getViteBuildOptions(options, context) {
|
|
76
|
+
const projectRoot = context.projectsConfigurations.projects[context.projectName].root;
|
|
77
|
+
return {
|
|
78
|
+
outDir: (0, _path.relative)(projectRoot, options.outputPath),
|
|
79
|
+
emptyOutDir: options.emptyOutDir,
|
|
80
|
+
reportCompressedSize: true,
|
|
81
|
+
cssCodeSplit: true,
|
|
82
|
+
target: 'esnext',
|
|
83
|
+
commonjsOptions: {
|
|
84
|
+
transformMixedEsModules: true
|
|
85
|
+
},
|
|
86
|
+
sourcemap: options.sourcemap,
|
|
87
|
+
minify: options.minify,
|
|
88
|
+
manifest: options.manifest,
|
|
89
|
+
ssrManifest: options.ssrManifest,
|
|
90
|
+
ssr: options.ssr,
|
|
91
|
+
watch: options.watch
|
|
92
|
+
};
|
|
93
|
+
}
|
|
94
|
+
function getVitePreviewOptions(options, context) {
|
|
95
|
+
const serverOptions = {
|
|
96
|
+
host: options.host,
|
|
97
|
+
port: options.port,
|
|
98
|
+
https: options.https,
|
|
99
|
+
open: options.open
|
|
100
|
+
};
|
|
101
|
+
const proxyConfigPath = getViteServerProxyConfigPath(options.proxyConfig, context);
|
|
102
|
+
if (proxyConfigPath) {
|
|
103
|
+
_devkit.logger.info(`Loading proxy configuration from: ${proxyConfigPath}`);
|
|
104
|
+
serverOptions.proxy = require(proxyConfigPath);
|
|
105
|
+
}
|
|
106
|
+
return serverOptions;
|
|
107
|
+
}
|
|
108
|
+
function getNxTargetOptions(target, context) {
|
|
109
|
+
const targetObj = (0, _devkit.parseTargetString)(target, context.projectGraph);
|
|
110
|
+
return (0, _devkit.readTargetOptions)(targetObj, context);
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
//# sourceMappingURL=options-utils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../packages/vite/src/utils/options-utils.ts"],"sourcesContent":["import {\n ExecutorContext,\n joinPathFragments,\n logger,\n parseTargetString,\n readTargetOptions,\n} from '@nx/devkit';\nimport { existsSync } from 'fs';\nimport { join, relative } from 'path';\nimport {\n BuildOptions,\n InlineConfig,\n PluginOption,\n PreviewOptions,\n searchForWorkspaceRoot,\n ServerOptions,\n} from 'vite';\nimport { ViteDevServerExecutorOptions } from '../executors/dev-server/schema';\nimport { VitePreviewServerExecutorOptions } from '../executors/preview-server/schema';\nimport replaceFiles from '../../plugins/rollup-replace-files.plugin';\nimport { ViteBuildExecutorOptions } from '../executors/build/schema';\nimport * as path from 'path';\n\n/**\n * Returns the path to the vite config file or undefined when not found.\n */\nexport function normalizeViteConfigFilePath(\n projectRoot: string,\n configFile?: string\n): string | undefined {\n return configFile && existsSync(joinPathFragments(configFile))\n ? configFile\n : existsSync(joinPathFragments(`${projectRoot}/vite.config.ts`))\n ? joinPathFragments(`${projectRoot}/vite.config.ts`)\n : existsSync(joinPathFragments(`${projectRoot}/vite.config.js`))\n ? joinPathFragments(`${projectRoot}/vite.config.js`)\n : undefined;\n}\n\n/**\n * Returns the path to the proxy configuration file or undefined when not found.\n */\nexport function getViteServerProxyConfigPath(\n nxProxyConfig: string | undefined,\n context: ExecutorContext\n): string | undefined {\n if (nxProxyConfig) {\n const projectRoot =\n context.projectsConfigurations.projects[context.projectName].root;\n\n const proxyConfigPath = nxProxyConfig\n ? join(context.root, nxProxyConfig)\n : join(projectRoot, 'proxy.conf.json');\n\n if (existsSync(proxyConfigPath)) {\n return proxyConfigPath;\n }\n }\n}\n\n/**\n * Builds the shared options for vite.\n *\n * Most shared options are derived from the build target.\n */\nexport function getViteSharedConfig(\n options: ViteBuildExecutorOptions,\n clearScreen: boolean | undefined,\n context: ExecutorContext\n): InlineConfig {\n const projectRoot =\n context.projectsConfigurations.projects[context.projectName].root;\n\n const root = path.relative(\n context.cwd,\n joinPathFragments(context.root, projectRoot)\n );\n\n return {\n mode: options.mode,\n root,\n base: options.base,\n configFile: normalizeViteConfigFilePath(projectRoot, options.configFile),\n plugins: [replaceFiles(options.fileReplacements) as PluginOption],\n optimizeDeps: { force: options.force },\n clearScreen: clearScreen,\n logLevel: options.logLevel,\n };\n}\n\n/**\n * Builds the options for the vite dev server.\n */\nexport function getViteServerOptions(\n options: ViteDevServerExecutorOptions,\n context: ExecutorContext\n): ServerOptions {\n const projectRoot =\n context.projectsConfigurations.projects[context.projectName].root;\n const serverOptions: ServerOptions = {\n host: options.host,\n port: options.port,\n https: options.https,\n hmr: options.hmr,\n open: options.open,\n cors: options.cors,\n fs: {\n allow: [\n searchForWorkspaceRoot(joinPathFragments(projectRoot)),\n joinPathFragments(context.root, 'node_modules/vite'),\n ],\n },\n };\n\n const proxyConfigPath = getViteServerProxyConfigPath(\n options.proxyConfig,\n context\n );\n if (proxyConfigPath) {\n logger.info(`Loading proxy configuration from: ${proxyConfigPath}`);\n serverOptions.proxy = require(proxyConfigPath);\n }\n\n return serverOptions;\n}\n\n/**\n * Builds the build options for the vite.\n */\nexport function getViteBuildOptions(\n options: ViteBuildExecutorOptions,\n context: ExecutorContext\n): BuildOptions {\n const projectRoot =\n context.projectsConfigurations.projects[context.projectName].root;\n\n return {\n outDir: relative(projectRoot, options.outputPath),\n emptyOutDir: options.emptyOutDir,\n reportCompressedSize: true,\n cssCodeSplit: true,\n target: 'esnext',\n commonjsOptions: {\n transformMixedEsModules: true,\n },\n sourcemap: options.sourcemap,\n minify: options.minify,\n manifest: options.manifest,\n ssrManifest: options.ssrManifest,\n ssr: options.ssr,\n watch: options.watch as BuildOptions['watch'],\n };\n}\n\n/**\n * Builds the options for the vite preview server.\n */\nexport function getVitePreviewOptions(\n options: VitePreviewServerExecutorOptions,\n context: ExecutorContext\n): PreviewOptions {\n const serverOptions: ServerOptions = {\n host: options.host,\n port: options.port,\n https: options.https,\n open: options.open,\n };\n\n const proxyConfigPath = getViteServerProxyConfigPath(\n options.proxyConfig,\n context\n );\n if (proxyConfigPath) {\n logger.info(`Loading proxy configuration from: ${proxyConfigPath}`);\n serverOptions.proxy = require(proxyConfigPath);\n }\n\n return serverOptions;\n}\n\nexport function getNxTargetOptions(target: string, context: ExecutorContext) {\n const targetObj = parseTargetString(target, context.projectGraph);\n return readTargetOptions(targetObj, context);\n}\n"],"names":["normalizeViteConfigFilePath","getViteServerProxyConfigPath","getViteSharedConfig","getViteServerOptions","getViteBuildOptions","getVitePreviewOptions","getNxTargetOptions","projectRoot","configFile","existsSync","joinPathFragments","undefined","nxProxyConfig","context","projectsConfigurations","projects","projectName","root","proxyConfigPath","join","options","clearScreen","path","relative","cwd","mode","base","plugins","replaceFiles","fileReplacements","optimizeDeps","force","logLevel","serverOptions","host","port","https","hmr","open","cors","fs","allow","searchForWorkspaceRoot","proxyConfig","logger","info","proxy","require","outDir","outputPath","emptyOutDir","reportCompressedSize","cssCodeSplit","target","commonjsOptions","transformMixedEsModules","sourcemap","minify","manifest","ssrManifest","ssr","watch","targetObj","parseTargetString","projectGraph","readTargetOptions"],"mappings":"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"}
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "my-test-angular-app",
|
|
3
|
+
"$schema": "../../node_modules/nx/schemas/project-schema.json",
|
|
4
|
+
"root": "apps/my-test-angular-app",
|
|
5
|
+
"sourceRoot": "apps/my-test-angular-app/src",
|
|
6
|
+
"projectType": "application",
|
|
7
|
+
"targets": {
|
|
8
|
+
"build": {
|
|
9
|
+
"executor": "@angular-devkit/build-angular:browser",
|
|
10
|
+
"outputs": ["{options.outputPath}"],
|
|
11
|
+
"options": {
|
|
12
|
+
"outputPath": "dist/apps/my-test-angular-app",
|
|
13
|
+
"index": "apps/my-test-angular-app/src/index.html",
|
|
14
|
+
"main": "apps/my-test-angular-app/src/main.ts",
|
|
15
|
+
"polyfills": ["zone.js"],
|
|
16
|
+
"tsConfig": "apps/my-test-angular-app/tsconfig.app.json",
|
|
17
|
+
"assets": [
|
|
18
|
+
"apps/my-test-angular-app/src/favicon.ico",
|
|
19
|
+
"apps/my-test-angular-app/src/assets"
|
|
20
|
+
],
|
|
21
|
+
"styles": ["apps/my-test-angular-app/src/styles.css"],
|
|
22
|
+
"scripts": []
|
|
23
|
+
},
|
|
24
|
+
"configurations": {
|
|
25
|
+
"production": {
|
|
26
|
+
"budgets": [
|
|
27
|
+
{
|
|
28
|
+
"type": "initial",
|
|
29
|
+
"maximumWarning": "500kb",
|
|
30
|
+
"maximumError": "1mb"
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
"type": "anyComponentStyle",
|
|
34
|
+
"maximumWarning": "2kb",
|
|
35
|
+
"maximumError": "4kb"
|
|
36
|
+
}
|
|
37
|
+
],
|
|
38
|
+
"outputHashing": "all"
|
|
39
|
+
},
|
|
40
|
+
"development": {
|
|
41
|
+
"buildOptimizer": false,
|
|
42
|
+
"optimization": false,
|
|
43
|
+
"vendorChunk": true,
|
|
44
|
+
"extractLicenses": false,
|
|
45
|
+
"sourceMap": true,
|
|
46
|
+
"namedChunks": true
|
|
47
|
+
}
|
|
48
|
+
},
|
|
49
|
+
"defaultConfiguration": "production"
|
|
50
|
+
},
|
|
51
|
+
"serve": {
|
|
52
|
+
"executor": "@angular-devkit/build-angular:dev-server",
|
|
53
|
+
"configurations": {
|
|
54
|
+
"production": {
|
|
55
|
+
"browserTarget": "my-test-angular-app:build:production"
|
|
56
|
+
},
|
|
57
|
+
"development": {
|
|
58
|
+
"browserTarget": "my-test-angular-app:build:development"
|
|
59
|
+
}
|
|
60
|
+
},
|
|
61
|
+
"defaultConfiguration": "development"
|
|
62
|
+
},
|
|
63
|
+
"extract-i18n": {
|
|
64
|
+
"executor": "@angular-devkit/build-angular:extract-i18n",
|
|
65
|
+
"options": {
|
|
66
|
+
"browserTarget": "my-test-angular-app:build"
|
|
67
|
+
}
|
|
68
|
+
},
|
|
69
|
+
"lint": {
|
|
70
|
+
"executor": "@nrwl/linter:eslint",
|
|
71
|
+
"outputs": ["{options.outputFile}"],
|
|
72
|
+
"options": {
|
|
73
|
+
"lintFilePatterns": [
|
|
74
|
+
"apps/my-test-angular-app/**/*.ts",
|
|
75
|
+
"apps/my-test-angular-app/**/*.html"
|
|
76
|
+
]
|
|
77
|
+
}
|
|
78
|
+
},
|
|
79
|
+
"test": {
|
|
80
|
+
"executor": "@nrwl/jest:jest",
|
|
81
|
+
"outputs": ["{workspaceRoot}/coverage/{projectRoot}"],
|
|
82
|
+
"options": {
|
|
83
|
+
"jestConfig": "apps/my-test-angular-app/jest.config.ts",
|
|
84
|
+
"passWithNoTests": true
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
},
|
|
88
|
+
"tags": []
|
|
89
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "react-lib-nonb-jest",
|
|
3
|
+
"$schema": "../../node_modules/nx/schemas/project-schema.json",
|
|
4
|
+
"root": "libs/react-lib-nonb-jest",
|
|
5
|
+
"sourceRoot": "libs/react-lib-nonb-jest/src",
|
|
6
|
+
"projectType": "library",
|
|
7
|
+
"targets": {
|
|
8
|
+
"lint": {
|
|
9
|
+
"executor": "@nrwl/linter:eslint",
|
|
10
|
+
"outputs": ["{options.outputFile}"],
|
|
11
|
+
"options": {
|
|
12
|
+
"lintFilePatterns": ["libs/react-lib-nonb-jest/**/*.{ts,tsx,js,jsx}"]
|
|
13
|
+
}
|
|
14
|
+
},
|
|
15
|
+
"test": {
|
|
16
|
+
"executor": "@nrwl/jest:jest",
|
|
17
|
+
"outputs": ["{workspaceRoot}/coverage/{projectRoot}"],
|
|
18
|
+
"options": {
|
|
19
|
+
"jestConfig": "libs/react-lib-nonb-jest/jest.config.ts",
|
|
20
|
+
"passWithNoTests": true
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
},
|
|
24
|
+
"tags": []
|
|
25
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "react-lib-nonb-vitest",
|
|
3
|
+
"$schema": "../../node_modules/nx/schemas/project-schema.json",
|
|
4
|
+
"root": "libs/react-lib-nonb-vitest",
|
|
5
|
+
"sourceRoot": "libs/react-lib-nonb-vitest/src",
|
|
6
|
+
"projectType": "library",
|
|
7
|
+
"targets": {
|
|
8
|
+
"lint": {
|
|
9
|
+
"executor": "@nrwl/linter:eslint",
|
|
10
|
+
"outputs": ["{options.outputFile}"],
|
|
11
|
+
"options": {
|
|
12
|
+
"lintFilePatterns": ["libs/react-lib-nonb-vitest/**/*.{ts,tsx,js,jsx}"]
|
|
13
|
+
}
|
|
14
|
+
},
|
|
15
|
+
"test": {
|
|
16
|
+
"executor": "@nrwl/vite:test",
|
|
17
|
+
"outputs": ["{projectRoot}/coverage"],
|
|
18
|
+
"options": {
|
|
19
|
+
"passWithNoTests": true,
|
|
20
|
+
"reportsDirectory": "{workspaceRoot}/coverage/{projectRoot}"
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
},
|
|
24
|
+
"tags": []
|
|
25
|
+
}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "my-test-mixed-react-app",
|
|
3
|
+
"$schema": "../../node_modules/nx/schemas/project-schema.json",
|
|
4
|
+
"root": "apps/my-test-mixed-react-app",
|
|
5
|
+
"sourceRoot": "apps/my-test-mixed-react-app/src",
|
|
6
|
+
"projectType": "application",
|
|
7
|
+
"targets": {
|
|
8
|
+
"invalid-build": {
|
|
9
|
+
"executor": "@nrwl/js:tsc",
|
|
10
|
+
"outputs": ["{options.outputPath}"]
|
|
11
|
+
},
|
|
12
|
+
"valid-build": {
|
|
13
|
+
"executor": "@nrwl/webpack:webpack",
|
|
14
|
+
"outputs": ["{options.outputPath}"]
|
|
15
|
+
},
|
|
16
|
+
"serve": {
|
|
17
|
+
"executor": "@nrwl/webpack:dev-server",
|
|
18
|
+
"defaultConfiguration": "development",
|
|
19
|
+
"options": {
|
|
20
|
+
"buildTarget": "my-test-mixed-react-app:build",
|
|
21
|
+
"hmr": true
|
|
22
|
+
},
|
|
23
|
+
"configurations": {
|
|
24
|
+
"development": {
|
|
25
|
+
"buildTarget": "my-test-mixed-react-app:build:development"
|
|
26
|
+
},
|
|
27
|
+
"production": {
|
|
28
|
+
"buildTarget": "my-test-mixed-react-app:build:production",
|
|
29
|
+
"hmr": false
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
},
|
|
33
|
+
"lint": {
|
|
34
|
+
"executor": "@nrwl/linter:eslint",
|
|
35
|
+
"outputs": ["{options.outputFile}"],
|
|
36
|
+
"options": {
|
|
37
|
+
"lintFilePatterns": [
|
|
38
|
+
"apps/my-test-mixed-react-app/**/*.{ts,tsx,js,jsx}"
|
|
39
|
+
]
|
|
40
|
+
}
|
|
41
|
+
},
|
|
42
|
+
"test": {
|
|
43
|
+
"executor": "@nrwl/jest:jest",
|
|
44
|
+
"outputs": ["{workspaceRoot}/coverage/{projectRoot}"],
|
|
45
|
+
"options": {
|
|
46
|
+
"jestConfig": "apps/my-test-mixed-react-app/jest.config.ts",
|
|
47
|
+
"passWithNoTests": true
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
},
|
|
51
|
+
"tags": []
|
|
52
|
+
}
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "my-test-react-app",
|
|
3
|
+
"$schema": "../../node_modules/nx/schemas/project-schema.json",
|
|
4
|
+
"root": "apps/my-test-react-app",
|
|
5
|
+
"sourceRoot": "apps/my-test-react-app/src",
|
|
6
|
+
"projectType": "application",
|
|
7
|
+
"targets": {
|
|
8
|
+
"build": {
|
|
9
|
+
"executor": "@nrwl/webpack:webpack",
|
|
10
|
+
"outputs": ["{options.outputPath}"],
|
|
11
|
+
"defaultConfiguration": "production",
|
|
12
|
+
"options": {
|
|
13
|
+
"compiler": "babel",
|
|
14
|
+
"outputPath": "dist/apps/my-test-react-app",
|
|
15
|
+
"index": "apps/my-test-react-app/src/index.html",
|
|
16
|
+
"baseHref": "/",
|
|
17
|
+
"main": "apps/my-test-react-app/src/main.tsx",
|
|
18
|
+
"polyfills": "apps/my-test-react-app/src/polyfills.ts",
|
|
19
|
+
"tsConfig": "apps/my-test-react-app/tsconfig.app.json",
|
|
20
|
+
"assets": [
|
|
21
|
+
"apps/my-test-react-app/src/favicon.ico",
|
|
22
|
+
"apps/my-test-react-app/src/assets"
|
|
23
|
+
],
|
|
24
|
+
"styles": ["apps/my-test-react-app/src/styles.css"],
|
|
25
|
+
"scripts": [],
|
|
26
|
+
"webpackConfig": "@nrwl/react/plugins/webpack"
|
|
27
|
+
},
|
|
28
|
+
"configurations": {
|
|
29
|
+
"development": {
|
|
30
|
+
"extractLicenses": false,
|
|
31
|
+
"optimization": false,
|
|
32
|
+
"sourceMap": true,
|
|
33
|
+
"vendorChunk": true
|
|
34
|
+
},
|
|
35
|
+
"production": {
|
|
36
|
+
"fileReplacements": [
|
|
37
|
+
{
|
|
38
|
+
"replace": "apps/my-test-react-app/src/environments/environment.ts",
|
|
39
|
+
"with": "apps/my-test-react-app/src/environments/environment.prod.ts"
|
|
40
|
+
}
|
|
41
|
+
],
|
|
42
|
+
"optimization": true,
|
|
43
|
+
"outputHashing": "all",
|
|
44
|
+
"sourceMap": false,
|
|
45
|
+
"namedChunks": false,
|
|
46
|
+
"extractLicenses": true,
|
|
47
|
+
"vendorChunk": false
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
},
|
|
51
|
+
"serve": {
|
|
52
|
+
"executor": "@nrwl/webpack:dev-server",
|
|
53
|
+
"defaultConfiguration": "development",
|
|
54
|
+
"options": {
|
|
55
|
+
"buildTarget": "my-test-react-app:build",
|
|
56
|
+
"hmr": true
|
|
57
|
+
},
|
|
58
|
+
"configurations": {
|
|
59
|
+
"development": {
|
|
60
|
+
"buildTarget": "my-test-react-app:build:development"
|
|
61
|
+
},
|
|
62
|
+
"production": {
|
|
63
|
+
"buildTarget": "my-test-react-app:build:production",
|
|
64
|
+
"hmr": false
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
},
|
|
68
|
+
"lint": {
|
|
69
|
+
"executor": "@nrwl/linter:eslint",
|
|
70
|
+
"outputs": ["{options.outputFile}"],
|
|
71
|
+
"options": {
|
|
72
|
+
"lintFilePatterns": ["apps/my-test-react-app/**/*.{ts,tsx,js,jsx}"]
|
|
73
|
+
}
|
|
74
|
+
},
|
|
75
|
+
"test": {
|
|
76
|
+
"executor": "@nrwl/jest:jest",
|
|
77
|
+
"outputs": ["{workspaceRoot}/coverage/{projectRoot}"],
|
|
78
|
+
"options": {
|
|
79
|
+
"jestConfig": "apps/my-test-react-app/jest.config.ts",
|
|
80
|
+
"passWithNoTests": true
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
},
|
|
84
|
+
"tags": []
|
|
85
|
+
}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "my-test-react-vite-app",
|
|
3
|
+
"$schema": "../../node_modules/nx/schemas/project-schema.json",
|
|
4
|
+
"root": "apps/my-test-react-vite-app",
|
|
5
|
+
"sourceRoot": "apps/my-test-react-vite-app/src",
|
|
6
|
+
"projectType": "application",
|
|
7
|
+
"targets": {
|
|
8
|
+
"build": {
|
|
9
|
+
"executor": "@nrwl/vite:build",
|
|
10
|
+
"outputs": ["{options.outputPath}"],
|
|
11
|
+
"defaultConfiguration": "production",
|
|
12
|
+
"options": {
|
|
13
|
+
"outputPath": "dist/apps/my-test-react-vite-app"
|
|
14
|
+
},
|
|
15
|
+
"configurations": {
|
|
16
|
+
"development": {},
|
|
17
|
+
"production": {},
|
|
18
|
+
"ssr": {
|
|
19
|
+
"ssr": true,
|
|
20
|
+
"my-other-setting": "my-other-value"
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
},
|
|
24
|
+
"serve": {
|
|
25
|
+
"executor": "@nrwl/vite:dev-server",
|
|
26
|
+
"defaultConfiguration": "development",
|
|
27
|
+
"options": {
|
|
28
|
+
"buildTarget": "my-test-react-vite-app:build"
|
|
29
|
+
},
|
|
30
|
+
"configurations": {
|
|
31
|
+
"development": {
|
|
32
|
+
"buildTarget": "my-test-react-vite-app:build:development",
|
|
33
|
+
"hmr": true
|
|
34
|
+
},
|
|
35
|
+
"production": {
|
|
36
|
+
"buildTarget": "my-test-react-vite-app:build:production",
|
|
37
|
+
"hmr": false
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
},
|
|
41
|
+
"test": {
|
|
42
|
+
"executor": "@nrwl/vite:test",
|
|
43
|
+
"outputs": ["{projectRoot}/coverage"],
|
|
44
|
+
"options": {
|
|
45
|
+
"passWithNoTests": true
|
|
46
|
+
}
|
|
47
|
+
},
|
|
48
|
+
"lint": {
|
|
49
|
+
"executor": "@nrwl/linter:eslint",
|
|
50
|
+
"outputs": ["{options.outputFile}"],
|
|
51
|
+
"options": {
|
|
52
|
+
"lintFilePatterns": ["apps/my-test-react-vite-app/**/*.{ts,tsx,js,jsx}"]
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
},
|
|
56
|
+
"tags": []
|
|
57
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
export declare const noBuildOptions = "\n /// <reference types=\"vitest\" />\n import { defineConfig } from 'vite';\n import react from '@vitejs/plugin-react';\n import viteTsConfigPaths from 'vite-tsconfig-paths';\n\n export default defineConfig({\n plugins: [\n react(),\n viteTsConfigPaths({\n root: '../../',\n }),\n ],\n\n test: {\n globals: true,\n cache: {\n dir: '../../node_modules/.vitest',\n },\n environment: 'jsdom',\n include: ['src/**/*.{test,spec}.{js,mjs,cjs,ts,mts,cts,jsx,tsx}'],\n },\n\n });\n ";
|
|
2
|
+
export declare const someBuildOptions = "\n /// <reference types=\"vitest\" />\n import { defineConfig } from 'vite';\n import react from '@vitejs/plugin-react';\n import viteTsConfigPaths from 'vite-tsconfig-paths';\n\n export default defineConfig({\n plugins: [\n react(),\n viteTsConfigPaths({\n root: '../../',\n }),\n ],\n\n test: {\n globals: true,\n cache: {\n dir: '../../node_modules/.vitest',\n },\n environment: 'jsdom',\n include: ['src/**/*.{test,spec}.{js,mjs,cjs,ts,mts,cts,jsx,tsx}'],\n },\n\n build: {\n my: 'option',\n }\n\n });\n ";
|
|
3
|
+
export declare const noContentDefineConfig = "\n /// <reference types=\"vitest\" />\n import { defineConfig } from 'vite';\n import react from '@vitejs/plugin-react';\n import viteTsConfigPaths from 'vite-tsconfig-paths';\n\n export default defineConfig({});\n ";
|
|
4
|
+
export declare const conditionalConfig = "\n /// <reference types=\"vitest\" />\n import { defineConfig } from 'vite';\n export default defineConfig(({ command, mode, ssrBuild }) => {\n if (command === 'serve') {\n return {\n port: 4200,\n host: 'localhost',\n }\n } else {\n // command === 'build'\n return {\n my: 'option',\n }\n }\n })\n ";
|
|
5
|
+
export declare const configNoDefineConfig = "\n /// <reference types=\"vitest\" />\n import { defineConfig } from 'vite';\n import react from '@vitejs/plugin-react';\n import viteTsConfigPaths from 'vite-tsconfig-paths';\n\n export default {\n plugins: [\n react(),\n viteTsConfigPaths({\n root: '../../',\n }),\n ],\n };\n ";
|
|
6
|
+
export declare const noBuildOptionsHasTestOption = "\n /// <reference types=\"vitest\" />\n import { defineConfig } from 'vite';\n import react from '@vitejs/plugin-react';\n import viteTsConfigPaths from 'vite-tsconfig-paths';\n\n export default defineConfig({\n plugins: [\n react(),\n viteTsConfigPaths({\n root: '../../',\n }),\n ],\n\n test: {\n globals: true,\n cache: {\n dir: '../../node_modules/.vitest',\n },\n environment: 'jsdom',\n include: ['src/**/*.{test,spec}.{js,mjs,cjs,ts,mts,cts,jsx,tsx}'],\n },\n\n });\n ";
|
|
7
|
+
export declare const someBuildOptionsSomeTestOption = "\n /// <reference types=\"vitest\" />\n import { defineConfig } from 'vite';\n import react from '@vitejs/plugin-react';\n import viteTsConfigPaths from 'vite-tsconfig-paths';\n\n export default defineConfig({\n plugins: [\n react(),\n viteTsConfigPaths({\n root: '../../',\n }),\n ],\n\n test: {\n my: 'option',\n },\n\n build: {\n my: 'option',\n }\n\n });\n ";
|
|
8
|
+
export declare const hasEverything = "\n /// <reference types=\"vitest\" />\n import { defineConfig } from 'vite';\n import react from '@vitejs/plugin-react';\n import viteTsConfigPaths from 'vite-tsconfig-paths';\n import dts from 'vite-plugin-dts';\n import { join } from 'path';\n\n export default defineConfig({\n plugins: [\n dts({\n entryRoot: 'src',\n tsConfigFilePath: join(__dirname, 'tsconfig.lib.json'),\n skipDiagnostics: true,\n }),\n react(),\n viteTsConfigPaths({\n root: '../../../',\n }),\n ],\n \n // Configuration for building your library.\n // See: https://vitejs.dev/guide/build.html#library-mode\n build: {\n lib: {\n // Could also be a dictionary or array of multiple entry points.\n entry: 'src/index.ts',\n name: 'pure-libs-react-vite',\n fileName: 'index',\n // Change this to the formats you want to support.\n // Don't forgot to update your package.json as well.\n formats: ['es', 'cjs'],\n },\n rollupOptions: {\n // External packages that should not be bundled into your library.\n external: ['react', 'react-dom', 'react/jsx-runtime'],\n },\n },\n \n test: {\n globals: true,\n cache: {\n dir: '../../../node_modules/.vitest',\n },\n environment: 'jsdom',\n include: ['src/**/*.{test,spec}.{js,mjs,cjs,ts,mts,cts,jsx,tsx}'],\n },\n });\n ";
|
|
9
|
+
export declare const buildOption = "\n // Configuration for building your library.\n // See: https://vitejs.dev/guide/build.html#library-mode\n build: {\n lib: {\n // Could also be a dictionary or array of multiple entry points.\n entry: 'src/index.ts',\n name: 'my-app',\n fileName: 'index',\n // Change this to the formats you want to support.\n // Don't forgot to update your package.json as well.\n formats: ['es', 'cjs']\n },\n rollupOptions: {\n // External packages that should not be bundled into your library.\n external: [\"'react', 'react-dom', 'react/jsx-runtime'\"]\n }\n },";
|
|
10
|
+
export declare const buildOptionObject: {
|
|
11
|
+
lib: {
|
|
12
|
+
entry: string;
|
|
13
|
+
name: string;
|
|
14
|
+
fileName: string;
|
|
15
|
+
formats: string[];
|
|
16
|
+
};
|
|
17
|
+
rollupOptions: {
|
|
18
|
+
external: string[];
|
|
19
|
+
};
|
|
20
|
+
};
|
|
21
|
+
export declare const testOption = "test: {\n globals: true,\n cache: {\n dir: '../node_modules/.vitest'\n },\n environment: 'jsdom',\n include: ['src/**/*.{test,spec}.{js,mjs,cjs,ts,mts,cts,jsx,tsx}'],\n },";
|
|
22
|
+
export declare const testOptionObject: {
|
|
23
|
+
globals: boolean;
|
|
24
|
+
cache: {
|
|
25
|
+
dir: string;
|
|
26
|
+
};
|
|
27
|
+
environment: string;
|
|
28
|
+
include: string[];
|
|
29
|
+
};
|
|
30
|
+
export declare const dtsPlugin = "dts({\n entryRoot: 'src',\n tsConfigFilePath: join(__dirname, 'tsconfig.lib.json'),\n skipDiagnostics: true,\n }),";
|
|
31
|
+
export declare const dtsImportLine = "import dts from 'vite-plugin-dts';\nimport { join } from 'path';";
|
|
32
|
+
export declare const pluginOption: string;
|