@nx/vite 20.4.3 → 20.4.5
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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nx/vite",
|
|
3
|
-
"version": "20.4.
|
|
3
|
+
"version": "20.4.5",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "The Nx Plugin for building and testing applications using Vite",
|
|
6
6
|
"repository": {
|
|
@@ -30,11 +30,11 @@
|
|
|
30
30
|
"migrations": "./migrations.json"
|
|
31
31
|
},
|
|
32
32
|
"dependencies": {
|
|
33
|
-
"@nx/devkit": "20.4.
|
|
33
|
+
"@nx/devkit": "20.4.5",
|
|
34
34
|
"@phenomnomnominal/tsquery": "~5.0.1",
|
|
35
35
|
"@swc/helpers": "~0.5.0",
|
|
36
36
|
"enquirer": "~2.3.6",
|
|
37
|
-
"@nx/js": "20.4.
|
|
37
|
+
"@nx/js": "20.4.5",
|
|
38
38
|
"tsconfig-paths": "^4.1.2",
|
|
39
39
|
"minimatch": "9.0.3"
|
|
40
40
|
},
|
|
@@ -13,6 +13,7 @@ function nxCopyAssetsPlugin(_assets) {
|
|
|
13
13
|
let config;
|
|
14
14
|
let handler;
|
|
15
15
|
let dispose;
|
|
16
|
+
if (global.NX_GRAPH_CREATION) return;
|
|
16
17
|
return {
|
|
17
18
|
name: 'nx-copy-assets-plugin',
|
|
18
19
|
configResolved (_config) {
|
|
@@ -35,7 +36,7 @@ function nxCopyAssetsPlugin(_assets) {
|
|
|
35
36
|
outputDir: (0, _nodepath.join)(config.root, config.build.outDir),
|
|
36
37
|
assets
|
|
37
38
|
});
|
|
38
|
-
if (this.meta.watchMode) {
|
|
39
|
+
if (this.meta.watchMode && (0, _devkit.isDaemonEnabled)()) {
|
|
39
40
|
dispose = await handler.watchAndProcessOnAssetChange();
|
|
40
41
|
}
|
|
41
42
|
},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../packages/vite/plugins/nx-copy-assets.plugin.ts"],"sourcesContent":["import { join, relative } from 'node:path';\nimport type { Plugin, ResolvedConfig } from 'vite';\nimport { joinPathFragments, workspaceRoot } from '@nx/devkit';\nimport { AssetGlob } from '@nx/js/src/utils/assets/assets';\nimport { CopyAssetsHandler } from '@nx/js/src/utils/assets/copy-assets-handler';\n\nexport function nxCopyAssetsPlugin(_assets: (string | AssetGlob)[]): Plugin {\n let config: ResolvedConfig;\n let handler: CopyAssetsHandler;\n let dispose: () => void;\n\n return {\n name: 'nx-copy-assets-plugin',\n configResolved(_config) {\n config = _config;\n },\n async buildStart() {\n const relativeProjectRoot = relative(workspaceRoot, config.root);\n const assets = _assets.map((a) => {\n if (typeof a === 'string') {\n return joinPathFragments(relativeProjectRoot, a);\n } else {\n return {\n ...a,\n input: joinPathFragments(relativeProjectRoot, a.input),\n };\n }\n });\n handler = new CopyAssetsHandler({\n rootDir: workspaceRoot,\n projectDir: config.root,\n outputDir: join(config.root, config.build.outDir),\n assets,\n });\n if (this.meta.watchMode) {\n dispose = await handler.watchAndProcessOnAssetChange();\n }\n },\n async writeBundle() {\n await handler.processAllAssetsOnce();\n },\n async closeWatcher() {\n dispose == null ? void 0 : dispose();\n },\n };\n}\n"],"names":["nxCopyAssetsPlugin","_assets","config","handler","dispose","name","configResolved","_config","buildStart","relativeProjectRoot","relative","workspaceRoot","root","assets","map","a","joinPathFragments","input","CopyAssetsHandler","rootDir","projectDir","outputDir","join","build","outDir","meta","watchMode","watchAndProcessOnAssetChange","writeBundle","processAllAssetsOnce","closeWatcher"],"rangeMappings":"
|
|
1
|
+
{"version":3,"sources":["../../../../packages/vite/plugins/nx-copy-assets.plugin.ts"],"sourcesContent":["import { join, relative } from 'node:path';\nimport type { Plugin, ResolvedConfig } from 'vite';\nimport { isDaemonEnabled, joinPathFragments, workspaceRoot } from '@nx/devkit';\nimport { AssetGlob } from '@nx/js/src/utils/assets/assets';\nimport { CopyAssetsHandler } from '@nx/js/src/utils/assets/copy-assets-handler';\n\nexport function nxCopyAssetsPlugin(_assets: (string | AssetGlob)[]): Plugin {\n let config: ResolvedConfig;\n let handler: CopyAssetsHandler;\n let dispose: () => void;\n\n if (global.NX_GRAPH_CREATION) return;\n\n return {\n name: 'nx-copy-assets-plugin',\n configResolved(_config) {\n config = _config;\n },\n async buildStart() {\n const relativeProjectRoot = relative(workspaceRoot, config.root);\n const assets = _assets.map((a) => {\n if (typeof a === 'string') {\n return joinPathFragments(relativeProjectRoot, a);\n } else {\n return {\n ...a,\n input: joinPathFragments(relativeProjectRoot, a.input),\n };\n }\n });\n handler = new CopyAssetsHandler({\n rootDir: workspaceRoot,\n projectDir: config.root,\n outputDir: join(config.root, config.build.outDir),\n assets,\n });\n if (this.meta.watchMode && isDaemonEnabled()) {\n dispose = await handler.watchAndProcessOnAssetChange();\n }\n },\n async writeBundle() {\n await handler.processAllAssetsOnce();\n },\n async closeWatcher() {\n dispose == null ? void 0 : dispose();\n },\n };\n}\n"],"names":["nxCopyAssetsPlugin","_assets","config","handler","dispose","global","NX_GRAPH_CREATION","name","configResolved","_config","buildStart","relativeProjectRoot","relative","workspaceRoot","root","assets","map","a","joinPathFragments","input","CopyAssetsHandler","rootDir","projectDir","outputDir","join","build","outDir","meta","watchMode","isDaemonEnabled","watchAndProcessOnAssetChange","writeBundle","processAllAssetsOnce","closeWatcher"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";+BAMgBA;;;eAAAA;;;;0BANe;wBAEmC;mCAEhC;AAE3B,SAASA,mBAAmBC,OAA+B;IAChE,IAAIC;IACJ,IAAIC;IACJ,IAAIC;IAEJ,IAAIC,OAAOC,iBAAiB,EAAE;IAE9B,OAAO;QACLC,MAAM;QACNC,gBAAeC,OAAO;YACpBP,SAASO;QACX;QACA,MAAMC;YACJ,MAAMC,sBAAsBC,IAAAA,kBAAQ,EAACC,qBAAa,EAAEX,OAAOY,IAAI;YAC/D,MAAMC,SAASd,QAAQe,GAAG,CAAC,CAACC;gBAC1B,IAAI,OAAOA,MAAM,UAAU;oBACzB,OAAOC,IAAAA,yBAAiB,EAACP,qBAAqBM;gBAChD,OAAO;oBACL,OAAO,eACFA;wBACHE,OAAOD,IAAAA,yBAAiB,EAACP,qBAAqBM,EAAEE,KAAK;;gBAEzD;YACF;YACAhB,UAAU,IAAIiB,oCAAiB,CAAC;gBAC9BC,SAASR,qBAAa;gBACtBS,YAAYpB,OAAOY,IAAI;gBACvBS,WAAWC,IAAAA,cAAI,EAACtB,OAAOY,IAAI,EAAEZ,OAAOuB,KAAK,CAACC,MAAM;gBAChDX;YACF;YACA,IAAI,IAAI,CAACY,IAAI,CAACC,SAAS,IAAIC,IAAAA,uBAAe,KAAI;gBAC5CzB,UAAU,MAAMD,QAAQ2B,4BAA4B;YACtD;QACF;QACA,MAAMC;YACJ,MAAM5B,QAAQ6B,oBAAoB;QACpC;QACA,MAAMC;YACJ7B,WAAW,OAAO,KAAK,IAAIA;QAC7B;IACF;AACF"}
|