@analogjs/vite-plugin-angular 0.2.0-beta.2 → 0.2.0-beta.21

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.
@@ -0,0 +1,4 @@
1
+ {
2
+ "$schema": "../../../node_modules/@angular-devkit/schematics/collection-schema.json",
3
+ "schematics": {}
4
+ }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@analogjs/vite-plugin-angular",
3
3
  "description": "Vite Plugin for Angular",
4
- "version": "0.2.0-beta.2",
4
+ "version": "0.2.0-beta.21",
5
5
  "keywords": [
6
6
  "vite",
7
7
  "vitest",
@@ -19,7 +19,19 @@
19
19
  "url": "https://github.com/analogjs/analog.git"
20
20
  },
21
21
  "peerDependencies": {
22
- "@angular-devkit/build-angular": "^15.0.0 || ^16.0.0-rc.0"
22
+ "@angular-devkit/build-angular": "^15.0.0 || ^16.0.0"
23
+ },
24
+ "ng-update": {
25
+ "packageGroup": [
26
+ "@analogjs/astro-angular",
27
+ "@analogjs/platform",
28
+ "@analogjs/content",
29
+ "@analogjs/router",
30
+ "@analogjs/trpc",
31
+ "@analogjs/vite-plugin-angular",
32
+ "@analogjs/vite-plugin-nitro"
33
+ ],
34
+ "migrations": "./migrations/migration.json"
23
35
  },
24
36
  "main": "./src/index.js",
25
37
  "types": "./src/index.d.ts"
@@ -0,0 +1,5 @@
1
+ import { Plugin } from 'vite';
2
+ export declare function buildOptimizerPlugin({ isProd, supportedBrowsers, }: {
3
+ isProd: boolean;
4
+ supportedBrowsers: string[];
5
+ }): Plugin;
@@ -0,0 +1,95 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.buildOptimizerPlugin = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const core_1 = require("@babel/core");
6
+ const devkit_1 = require("./utils/devkit");
7
+ function buildOptimizerPlugin({ isProd, supportedBrowsers, }) {
8
+ return {
9
+ name: '@analogjs/vite-plugin-angular-optimizer',
10
+ apply: 'build',
11
+ config() {
12
+ return {
13
+ esbuild: {
14
+ legalComments: 'none',
15
+ keepNames: false,
16
+ define: isProd
17
+ ? {
18
+ ngDevMode: 'false',
19
+ ngJitMode: 'false',
20
+ ngI18nClosureMode: 'false',
21
+ }
22
+ : undefined,
23
+ supported: {
24
+ // Native async/await is not supported with Zone.js. Disabling support here will cause
25
+ // esbuild to downlevel async/await to a Zone.js supported form.
26
+ 'async-await': false,
27
+ // Zone.js also does not support async generators or async iterators. However, esbuild does
28
+ // not currently support downleveling either of them. Instead babel is used within the JS/TS
29
+ // loader to perform the downlevel transformation. They are both disabled here to allow
30
+ // esbuild to handle them in the future if support is ever added.
31
+ // NOTE: If esbuild adds support in the future, the babel support for these can be disabled.
32
+ 'async-generator': false,
33
+ 'for-await': false,
34
+ 'class-field': false,
35
+ 'class-static-field': false,
36
+ },
37
+ },
38
+ };
39
+ },
40
+ transform(code, id) {
41
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
42
+ if (/\.[cm]?js$/.test(id)) {
43
+ const angularPackage = /[\\/]node_modules[\\/]@angular[\\/]/.test(id);
44
+ const linkerPluginCreator = (yield (0, devkit_1.loadEsmModule)('@angular/compiler-cli/linker/babel')).createEs2015LinkerPlugin;
45
+ const forceAsyncTransformation = !/[\\/][_f]?esm2015[\\/]/.test(id) &&
46
+ /for\s+await\s*\(|async\s+function\s*\*/.test(code);
47
+ const shouldLink = yield (0, devkit_1.requiresLinking)(id, code);
48
+ const useInputSourcemap = (!isProd ? undefined : false);
49
+ if (!forceAsyncTransformation && !isProd && !shouldLink) {
50
+ return {
51
+ code: isProd
52
+ ? code.replace(/^\/\/# sourceMappingURL=[^\r\n]*/gm, '')
53
+ : code,
54
+ };
55
+ }
56
+ const result = yield (0, core_1.transformAsync)(code, {
57
+ filename: id,
58
+ inputSourceMap: useInputSourcemap,
59
+ sourceMaps: !isProd ? 'inline' : false,
60
+ compact: false,
61
+ configFile: false,
62
+ babelrc: false,
63
+ browserslistConfigFile: false,
64
+ plugins: [],
65
+ presets: [
66
+ [
67
+ devkit_1.angularApplicationPreset,
68
+ {
69
+ angularLinker: {
70
+ shouldLink,
71
+ jitMode: false,
72
+ linkerPluginCreator,
73
+ },
74
+ forceAsyncTransformation,
75
+ supportedBrowsers,
76
+ optimize: isProd && {
77
+ looseEnums: angularPackage,
78
+ pureTopLevel: angularPackage,
79
+ },
80
+ },
81
+ ],
82
+ ],
83
+ });
84
+ return {
85
+ code: (result === null || result === void 0 ? void 0 : result.code) || '',
86
+ map: result === null || result === void 0 ? void 0 : result.map,
87
+ };
88
+ }
89
+ return;
90
+ });
91
+ },
92
+ };
93
+ }
94
+ exports.buildOptimizerPlugin = buildOptimizerPlugin;
95
+ //# sourceMappingURL=angular-build-optimizer-plugin.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"angular-build-optimizer-plugin.js","sourceRoot":"","sources":["../../../../../packages/vite-plugin-angular/src/lib/angular-build-optimizer-plugin.ts"],"names":[],"mappings":";;;;AACA,sCAA6C;AAC7C,2CAIwB;AAExB,SAAgB,oBAAoB,CAAC,EACnC,MAAM,EACN,iBAAiB,GAIlB;IACC,OAAO;QACL,IAAI,EAAE,yCAAyC;QAC/C,KAAK,EAAE,OAAO;QACd,MAAM;YACJ,OAAO;gBACL,OAAO,EAAE;oBACP,aAAa,EAAE,MAAM;oBACrB,SAAS,EAAE,KAAK;oBAChB,MAAM,EAAE,MAAM;wBACZ,CAAC,CAAC;4BACE,SAAS,EAAE,OAAO;4BAClB,SAAS,EAAE,OAAO;4BAClB,iBAAiB,EAAE,OAAO;yBAC3B;wBACH,CAAC,CAAC,SAAS;oBACb,SAAS,EAAE;wBACT,sFAAsF;wBACtF,gEAAgE;wBAChE,aAAa,EAAE,KAAK;wBACpB,2FAA2F;wBAC3F,4FAA4F;wBAC5F,uFAAuF;wBACvF,iEAAiE;wBACjE,4FAA4F;wBAC5F,iBAAiB,EAAE,KAAK;wBACxB,WAAW,EAAE,KAAK;wB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gCACE,iCAAwB;gCACxB;oCACE,aAAa,EAAE;wCACb,UAAU;wCACV,OAAO,EAAE,KAAK;wCACd,mBAAmB;qCACpB;oCACD,wBAAwB;oCACxB,iBAAiB;oCACjB,QAAQ,EAAE,MAAM,IAAI;wCAClB,UAAU,EAAE,cAAc;wCAC1B,YAAY,EAAE,cAAc;qCAC7B;iCACF;6BACF;yBACF;qBACF,CAAC,CAAC;oBAEH,OAAO;wBACL,IAAI,EAAE,CAAA,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,IAAI,KAAI,EAAE;wBACxB,GAAG,EAAE,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,GAAU;qBACxB,CAAC;iBACH;gBAED,OAAO;YACT,CAAC;SAAA;KACF,CAAC;AACJ,CAAC;AArGD,oDAqGC"}
@@ -0,0 +1,4 @@
1
+ import { Plugin } from 'vite';
2
+ export declare function jitPlugin({ inlineStylesExtension, }: {
3
+ inlineStylesExtension: string;
4
+ }): Plugin;
@@ -0,0 +1,58 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.jitPlugin = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const fs_1 = require("fs");
6
+ function jitPlugin({ inlineStylesExtension, }) {
7
+ let styleTransform;
8
+ let watchMode = false;
9
+ let viteServer;
10
+ let cssPlugin;
11
+ return {
12
+ name: '@analogjs/vite-plugin-angular-jit',
13
+ config(_config, { command }) {
14
+ watchMode = command === 'serve';
15
+ },
16
+ buildStart({ plugins }) {
17
+ if (Array.isArray(plugins)) {
18
+ cssPlugin = plugins.find((plugin) => plugin.name === 'vite:css');
19
+ }
20
+ styleTransform = watchMode
21
+ ? viteServer.pluginContainer.transform
22
+ : cssPlugin.transform;
23
+ },
24
+ configureServer(server) {
25
+ viteServer = server;
26
+ },
27
+ resolveId(id) {
28
+ if (id.startsWith('virtual:angular')) {
29
+ return `\0${id}`;
30
+ }
31
+ return;
32
+ },
33
+ load(id) {
34
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
35
+ if (id.includes('virtual:angular:jit:template:file;')) {
36
+ const contents = (0, fs_1.readFileSync)(id.split('file;')[1], 'utf-8');
37
+ return `export default \`${contents}\`;`;
38
+ }
39
+ else if (id.includes('virtual:angular:jit:style:inline;')) {
40
+ const styleId = id.split('style:inline;')[1];
41
+ const decodedStyles = Buffer.from(decodeURIComponent(styleId), 'base64').toString();
42
+ let styles = '';
43
+ try {
44
+ const compiled = yield styleTransform(decodedStyles, `${styleId}.${inlineStylesExtension}?direct`);
45
+ styles = compiled === null || compiled === void 0 ? void 0 : compiled.code;
46
+ }
47
+ catch (e) {
48
+ console.error(`${e}`);
49
+ }
50
+ return `export default \`${styles}\``;
51
+ }
52
+ return;
53
+ });
54
+ },
55
+ };
56
+ }
57
+ exports.jitPlugin = jitPlugin;
58
+ //# sourceMappingURL=angular-jit-plugin.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"angular-jit-plugin.js","sourceRoot":"","sources":["../../../../../packages/vite-plugin-angular/src/lib/angular-jit-plugin.ts"],"names":[],"mappings":";;;;AACA,2BAAkC;AAElC,SAAgB,SAAS,CAAC,EACxB,qBAAqB,GAGtB;IACC,IAAI,cAAwD,CAAC;IAC7D,IAAI,SAAS,GAAG,KAAK,CAAC;IACtB,IAAI,UAAqC,CAAC;IAC1C,IAAI,SAA6B,CAAC;IAElC,OAAO;QACL,IAAI,EAAE,mCAAmC;QACzC,MAAM,CAAC,OAAO,EAAE,EAAE,OAAO,EAAE;YACzB,SAAS,GAAG,OAAO,KAAK,OAAO,CAAC;QAClC,CAAC;QACD,UAAU,CAAC,EAAE,OAAO,EAAE;YACpB,IAAI,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE;gBAC1B,SAAS,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC,IAAI,KAAK,UAAU,CAAC,CAAC;aAClE;YAED,cAAc,GAAG,SAAS;gBACxB,CAA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F,CAAC;AACJ,CAAC;AAjED,8BAiEC"}
@@ -1,9 +1,10 @@
1
- import * as ts from 'typescript';
2
1
  import { Plugin } from 'vite';
2
+ import * as ts from 'typescript';
3
3
  export interface PluginOptions {
4
4
  tsconfig?: string;
5
5
  workspaceRoot?: string;
6
6
  inlineStylesExtension?: string;
7
+ jit?: boolean;
7
8
  advanced?: {
8
9
  /**
9
10
  * Custom TypeScript transformers that are run before Angular compilation
@@ -3,13 +3,14 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.createFileEmitter = exports.angular = void 0;
4
4
  const tslib_1 = require("tslib");
5
5
  const core_1 = require("@babel/core");
6
- const application_1 = require("@angular-devkit/build-angular/src/babel/presets/application");
7
- const webpack_loader_1 = require("@angular-devkit/build-angular/src/babel/webpack-loader");
8
6
  const ts = require("typescript");
9
- const load_esm_1 = require("@angular-devkit/build-angular/src/utils/load-esm");
7
+ const path = require("path");
10
8
  const compiler_plugin_1 = require("./compiler-plugin");
11
9
  const component_resolvers_1 = require("./component-resolvers");
12
10
  const host_1 = require("./host");
11
+ const angular_jit_plugin_1 = require("./angular-jit-plugin");
12
+ const angular_build_optimizer_plugin_1 = require("./angular-build-optimizer-plugin");
13
+ const devkit_1 = require("./utils/devkit");
13
14
  /**
14
15
  * TypeScript file extension regex
15
16
  * Match .(c or m)ts, .ts extensions with an optional ? for query params
@@ -35,7 +36,8 @@ function angular(options) {
35
36
  afterDeclarations: (_m = (_l = (_k = options === null || options === void 0 ? void 0 : options.advanced) === null || _k === void 0 ? void 0 : _k.tsTransformers) === null || _l === void 0 ? void 0 : _l.afterDeclarations) !== null && _m !== void 0 ? _m : [],
36
37
  },
37
38
  },
38
- supportedBrowsers: (_o = options === null || options === void 0 ? void 0 : options.supportedBrowsers) !== null && _o !== void 0 ? _o : ['iOS <=15'],
39
+ supportedBrowsers: (_o = options === null || options === void 0 ? void 0 : options.supportedBrowsers) !== null && _o !== void 0 ? _o : ['safari 15'],
40
+ jit: options === null || options === void 0 ? void 0 : options.jit,
39
41
  };
40
42
  // The file emitter created during `onStart` that will be used during the build in `onLoad` callbacks for TS files
41
43
  let fileEmitter;
@@ -43,45 +45,45 @@ function angular(options) {
43
45
  // Temporary deep import for transformer support
44
46
  const { mergeTransformers, replaceBootstrap, } = require('@ngtools/webpack/src/ivy/transformation');
45
47
  const { augmentProgramWithVersioning, augmentHostWithCaching, } = require('@ngtools/webpack/src/ivy/host');
46
- const { SourceFileCache } = require('@ngtools/webpack/src/ivy/cache');
47
48
  let compilerCli;
48
49
  let rootNames;
49
50
  let host;
50
51
  let nextProgram;
51
52
  let builderProgram;
52
53
  let watchMode = false;
53
- const sourceFileCache = new SourceFileCache();
54
+ const sourceFileCache = new devkit_1.SourceFileCache();
54
55
  const isProd = process.env['NODE_ENV'] === 'production';
55
56
  const isTest = process.env['NODE_ENV'] === 'test' || !!process.env['VITEST'];
57
+ const jit = typeof (pluginOptions === null || pluginOptions === void 0 ? void 0 : pluginOptions.jit) !== 'undefined' ? pluginOptions.jit : isTest;
56
58
  let viteServer;
57
59
  let cssPlugin;
58
- return [
59
- {
60
+ let styleTransform;
61
+ function angularPlugin() {
62
+ return {
60
63
  name: '@analogjs/vite-plugin-angular',
61
64
  config(config, { command }) {
62
- var _a, _b, _c;
65
+ var _a;
63
66
  return tslib_1.__awaiter(this, void 0, void 0, function* () {
64
67
  watchMode = command === 'serve';
65
- const target = Array.isArray((_a = config.build) === null || _a === void 0 ? void 0 : _a.target)
66
- ? (_b = config.build) === null || _b === void 0 ? void 0 : _b.target
67
- : [((_c = config.build) === null || _c === void 0 ? void 0 : _c.target) || 'es2020'];
68
- compilerCli = yield (0, load_esm_1.loadEsmModule)('@angular/compiler-cli');
68
+ pluginOptions.tsconfig =
69
+ (_a = options === null || options === void 0 ? void 0 : options.tsconfig) !== null && _a !== void 0 ? _a : path.resolve(config.root || '.', process.env['NODE_ENV'] === 'test'
70
+ ? './tsconfig.spec.json'
71
+ : './tsconfig.app.json');
72
+ compilerCli = yield (0, devkit_1.loadEsmModule)('@angular/compiler-cli');
69
73
  return {
70
74
  optimizeDeps: {
71
75
  include: ['rxjs/operators', 'rxjs'],
76
+ exclude: ['@angular/platform-server'],
72
77
  esbuildOptions: {
73
78
  plugins: [
74
79
  (0, compiler_plugin_1.createCompilerPlugin)({
75
80
  tsconfig: pluginOptions.tsconfig,
76
81
  sourcemap: !isProd,
77
82
  advancedOptimizations: isProd,
83
+ jit,
78
84
  }),
79
85
  ],
80
- define: {
81
- ngDevMode: watchMode ? JSON.stringify({}) : 'false',
82
- ngJitMode: 'false',
83
- ngI18nClosureMode: 'false',
84
- },
86
+ define: Object.assign({ ngJitMode: 'false', ngI18nClosureMode: 'false' }, (watchMode ? {} : { ngDevMode: 'false' })),
85
87
  },
86
88
  },
87
89
  resolve: {
@@ -111,7 +113,7 @@ function angular(options) {
111
113
  handleHotUpdate(ctx) {
112
114
  return tslib_1.__awaiter(this, void 0, void 0, function* () {
113
115
  if (TS_EXT_REGEX.test(ctx.file)) {
114
- sourceFileCache.invalidate(ctx.file.replace(/\?(.*)/, ''));
116
+ sourceFileCache.invalidate([ctx.file.replace(/\?(.*)/, '')]);
115
117
  yield buildAndAnalyze();
116
118
  }
117
119
  if (/\.(html|htm|css|less|sass|scss)$/.test(ctx.file)) {
@@ -126,7 +128,7 @@ function angular(options) {
126
128
  const mods = [];
127
129
  ctx.modules.forEach((mod) => {
128
130
  mod.importers.forEach((imp) => {
129
- sourceFileCache.invalidate(imp.id);
131
+ sourceFileCache.invalidate([imp.id]);
130
132
  ctx.server.moduleGraph.invalidateModule(imp);
131
133
  mods.push(imp);
132
134
  });
@@ -168,34 +170,57 @@ function angular(options) {
168
170
  if (isTest) {
169
171
  const tsMod = viteServer === null || viteServer === void 0 ? void 0 : viteServer.moduleGraph.getModuleById(id);
170
172
  if (tsMod) {
171
- sourceFileCache.invalidate(id);
173
+ sourceFileCache.invalidate([id]);
172
174
  yield buildAndAnalyze();
173
175
  }
174
176
  }
177
+ let templateUrls = [];
178
+ let styleUrls = [];
179
+ if ((0, component_resolvers_1.hasTemplateUrl)(code)) {
180
+ templateUrls = (0, component_resolvers_1.resolveTemplateUrls)(code, id);
181
+ }
182
+ if ((0, component_resolvers_1.hasStyleUrls)(code)) {
183
+ styleUrls = (0, component_resolvers_1.resolveStyleUrls)(code, id);
184
+ }
175
185
  if (watchMode) {
176
- if ((0, component_resolvers_1.hasTemplateUrl)(code)) {
177
- const templateUrls = (0, component_resolvers_1.resolveTemplateUrls)(code, id);
178
- templateUrls.forEach((templateUrl) => {
179
- this.addWatchFile(templateUrl);
180
- });
181
- }
182
- if ((0, component_resolvers_1.hasStyleUrls)(code)) {
183
- const styleUrls = (0, component_resolvers_1.resolveStyleUrls)(code, id);
184
- styleUrls.forEach((styleUrl) => {
185
- this.addWatchFile(styleUrl);
186
- });
187
- }
186
+ templateUrls.forEach((templateUrlSet) => {
187
+ const [, templateUrl] = templateUrlSet.split('|');
188
+ this.addWatchFile(templateUrl);
189
+ });
190
+ styleUrls.forEach((styleUrlSet) => {
191
+ const [, styleUrl] = styleUrlSet.split('|');
192
+ this.addWatchFile(styleUrl);
193
+ });
188
194
  }
189
195
  const typescriptResult = yield fileEmitter(id);
190
196
  // return fileEmitter
191
- const data = (_a = typescriptResult === null || typescriptResult === void 0 ? void 0 : typescriptResult.content) !== null && _a !== void 0 ? _a : '';
197
+ let data = (_a = typescriptResult === null || typescriptResult === void 0 ? void 0 : typescriptResult.content) !== null && _a !== void 0 ? _a : '';
198
+ if (jit && data.includes('angular:jit:')) {
199
+ data = data.replace(/angular:jit:style:inline;/g, 'virtual:angular:jit:style:inline;');
200
+ templateUrls.forEach((templateUrlSet) => {
201
+ const [templateFile, resolvedTemplateUrl] = templateUrlSet.split('|');
202
+ if (watchMode) {
203
+ data = data.replace(`angular:jit:template:file;${templateFile}`, `virtual:angular:jit:template:file;${resolvedTemplateUrl}`);
204
+ }
205
+ else {
206
+ data = data.replace(`angular:jit:template:file;${templateFile}`, `${resolvedTemplateUrl}?raw`);
207
+ }
208
+ });
209
+ styleUrls.forEach((styleUrlSet) => {
210
+ const [styleFile, resolvedStyleUrl] = styleUrlSet.split('|');
211
+ data = data.replace(`angular:jit:style:file;${styleFile}`, `${resolvedStyleUrl}?inline`);
212
+ });
213
+ }
214
+ if (jit) {
215
+ return {
216
+ code: data.replace(/^\/\/# sourceMappingURL=[^\r\n]*/gm, ''),
217
+ };
218
+ }
192
219
  const forceAsyncTransformation = /for\s+await\s*\(|async\s+function\s*\*/.test(data);
193
220
  const useInputSourcemap = (!isProd ? undefined : false);
194
221
  if (!forceAsyncTransformation && !isProd) {
195
222
  return {
196
- code: isProd
197
- ? data.replace(/^\/\/# sourceMappingURL=[^\r\n]*/gm, '')
198
- : data,
223
+ code: data.replace(/^\/\/# sourceMappingURL=[^\r\n]*/gm, ''),
199
224
  };
200
225
  }
201
226
  const babelResult = yield (0, core_1.transformAsync)(data, {
@@ -211,7 +236,7 @@ function angular(options) {
211
236
  plugins: [],
212
237
  presets: [
213
238
  [
214
- application_1.default,
239
+ devkit_1.angularApplicationPreset,
215
240
  {
216
241
  supportedBrowsers: pluginOptions.supportedBrowsers,
217
242
  forceAsyncTransformation,
@@ -228,90 +253,19 @@ function angular(options) {
228
253
  return undefined;
229
254
  });
230
255
  },
231
- },
232
- {
233
- name: '@analogjs/vite-plugin-angular-optimizer',
234
- apply: 'build',
235
- config() {
236
- return {
237
- esbuild: {
238
- legalComments: 'none',
239
- keepNames: false,
240
- define: isProd
241
- ? {
242
- ngDevMode: 'false',
243
- ngJitMode: 'false',
244
- ngI18nClosureMode: 'false',
245
- }
246
- : undefined,
247
- supported: {
248
- // Native async/await is not supported with Zone.js. Disabling support here will cause
249
- // esbuild to downlevel async/await to a Zone.js supported form.
250
- 'async-await': false,
251
- // Zone.js also does not support async generators or async iterators. However, esbuild does
252
- // not currently support downleveling either of them. Instead babel is used within the JS/TS
253
- // loader to perform the downlevel transformation. They are both disabled here to allow
254
- // esbuild to handle them in the future if support is ever added.
255
- // NOTE: If esbuild adds support in the future, the babel support for these can be disabled.
256
- 'async-generator': false,
257
- 'for-await': false,
258
- },
259
- },
260
- };
261
- },
262
- transform(code, id) {
263
- return tslib_1.__awaiter(this, void 0, void 0, function* () {
264
- if (/\.[cm]?js$/.test(id)) {
265
- const angularPackage = /[\\/]node_modules[\\/]@angular[\\/]/.test(id);
266
- const linkerPluginCreator = (yield (0, load_esm_1.loadEsmModule)('@angular/compiler-cli/linker/babel')).createEs2015LinkerPlugin;
267
- const forceAsyncTransformation = !/[\\/][_f]?esm2015[\\/]/.test(id) &&
268
- /for\s+await\s*\(|async\s+function\s*\*/.test(code);
269
- const shouldLink = yield (0, webpack_loader_1.requiresLinking)(id, code);
270
- const useInputSourcemap = (!isProd ? undefined : false);
271
- if (!forceAsyncTransformation && !isProd && !shouldLink) {
272
- return {
273
- code: isProd
274
- ? code.replace(/^\/\/# sourceMappingURL=[^\r\n]*/gm, '')
275
- : code,
276
- };
277
- }
278
- const result = yield (0, core_1.transformAsync)(code, {
279
- filename: id,
280
- inputSourceMap: useInputSourcemap,
281
- sourceMaps: !isProd ? 'inline' : false,
282
- compact: false,
283
- configFile: false,
284
- babelrc: false,
285
- browserslistConfigFile: false,
286
- plugins: [],
287
- presets: [
288
- [
289
- application_1.default,
290
- {
291
- angularLinker: {
292
- shouldLink,
293
- jitMode: false,
294
- linkerPluginCreator,
295
- },
296
- forceAsyncTransformation,
297
- optimize: isProd && {
298
- looseEnums: angularPackage,
299
- pureTopLevel: angularPackage,
300
- },
301
- },
302
- ],
303
- ],
304
- });
305
- return {
306
- code: (result === null || result === void 0 ? void 0 : result.code) || '',
307
- map: result === null || result === void 0 ? void 0 : result.map,
308
- };
309
- }
310
- return;
311
- });
312
- },
313
- },
314
- ];
256
+ };
257
+ }
258
+ return [
259
+ angularPlugin(),
260
+ (jit &&
261
+ (0, angular_jit_plugin_1.jitPlugin)({
262
+ inlineStylesExtension: pluginOptions.inlineStylesExtension,
263
+ })),
264
+ (0, angular_build_optimizer_plugin_1.buildOptimizerPlugin)({
265
+ isProd,
266
+ supportedBrowsers: pluginOptions.supportedBrowsers,
267
+ }),
268
+ ].filter(Boolean);
315
269
  function setupCompilation() {
316
270
  const { options: tsCompilerOptions, rootNames: rn } = compilerCli.readConfiguration(pluginOptions.tsconfig, {
317
271
  enableIvy: true,
@@ -332,12 +286,14 @@ function angular(options) {
332
286
  rootNames = rn;
333
287
  compilerOptions = tsCompilerOptions;
334
288
  host = ts.createIncrementalCompilerHost(compilerOptions);
335
- const styleTransform = watchMode
289
+ styleTransform = watchMode
336
290
  ? viteServer.pluginContainer.transform
337
291
  : cssPlugin.transform;
338
- (0, host_1.augmentHostWithResources)(host, styleTransform, {
339
- inlineStylesExtension: pluginOptions.inlineStylesExtension,
340
- });
292
+ if (!jit) {
293
+ (0, host_1.augmentHostWithResources)(host, styleTransform, {
294
+ inlineStylesExtension: pluginOptions.inlineStylesExtension,
295
+ });
296
+ }
341
297
  }
342
298
  /**
343
299
  * Creates a new NgtscProgram to analyze/re-analyze
@@ -346,32 +302,46 @@ function angular(options) {
346
302
  */
347
303
  function buildAndAnalyze() {
348
304
  return tslib_1.__awaiter(this, void 0, void 0, function* () {
349
- // Create the Angular specific program that contains the Angular compiler
350
- const angularProgram = new compilerCli.NgtscProgram(rootNames, compilerOptions, host, nextProgram);
351
- const angularCompiler = angularProgram.compiler;
352
- const typeScriptProgram = angularProgram.getTsProgram();
353
- augmentProgramWithVersioning(typeScriptProgram);
354
305
  let builder;
355
- if (watchMode) {
306
+ let typeScriptProgram;
307
+ let angularCompiler;
308
+ if (!jit) {
309
+ // Create the Angular specific program that contains the Angular compiler
310
+ const angularProgram = new compilerCli.NgtscProgram(rootNames, compilerOptions, host, nextProgram);
311
+ angularCompiler = angularProgram.compiler;
312
+ typeScriptProgram = angularProgram.getTsProgram();
313
+ augmentProgramWithVersioning(typeScriptProgram);
356
314
  builder = builderProgram =
357
315
  ts.createEmitAndSemanticDiagnosticsBuilderProgram(typeScriptProgram, host, builderProgram);
316
+ yield angularCompiler.analyzeAsync();
358
317
  nextProgram = angularProgram;
359
318
  }
360
319
  else {
320
+ builder = builderProgram =
321
+ ts.createEmitAndSemanticDiagnosticsBuilderProgram(rootNames, compilerOptions, host, nextProgram);
322
+ typeScriptProgram = builder.getProgram();
323
+ nextProgram = builderProgram;
324
+ }
325
+ if (!watchMode) {
361
326
  // When not in watch mode, the startup cost of the incremental analysis can be avoided by
362
327
  // using an abstract builder that only wraps a TypeScript program.
363
328
  builder = ts.createAbstractBuilder(typeScriptProgram, host);
364
329
  }
365
- yield angularCompiler.analyzeAsync();
366
330
  const getTypeChecker = () => builder.getProgram().getTypeChecker();
367
331
  fileEmitter = createFileEmitter(builder, mergeTransformers({
368
332
  before: [
369
333
  replaceBootstrap(getTypeChecker),
334
+ ...(jit
335
+ ? [
336
+ compilerCli.constructorParametersDownlevelTransform(builder.getProgram()),
337
+ (0, devkit_1.createJitResourceTransformer)(getTypeChecker),
338
+ ]
339
+ : []),
370
340
  ...pluginOptions.advanced.tsTransformers.before,
371
341
  ],
372
342
  after: pluginOptions.advanced.tsTransformers.after,
373
343
  afterDeclarations: pluginOptions.advanced.tsTransformers.afterDeclarations,
374
- }, angularCompiler.prepareEmit().transformers), () => []);
344
+ }, jit ? {} : angularCompiler.prepareEmit().transformers), () => []);
375
345
  });
376
346
  }
377
347
  }
@@ -1 +1 @@
1
- {"version":3,"file":"angular-vite-plugin.js","sourceRoot":"","sources":["../../../../../packages/vite-plugin-angular/src/lib/angular-vite-plugin.ts"],"names":[],"mappings":";;;;AACA,sCAA6C;AAC7C,6FAAmG;AACnG,2FAAyF;AACzF,iCAAiC;AAEjC,+EAAiF;AACjF,uDAAyD;AACzD,+DAK+B;AAC/B,iCAAkD;AAuBlD;;;;GAIG;AACH,MAAM,YAAY,GAAG,mBAAmB,CAAC;AAEzC,SAAgB,OAAO,CAAC,OAAuB;;IAC7C;;;OAGG;IACH,MAAM,aAAa,GAAG;QACpB,QAAQ,EACN,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cAAc,CAAC,KAAK;gBAClD,iBAAiB,EACf,aAAa,CAAC,QAAQ,CAAC,cAAc,CAAC,iBAAiB;aAC1D,EACD,eAAe,CAAC,WAAW,EAAE,CAAC,YAAY,CAC3C,EACD,GAAG,EAAE,CAAC,EAAE,CACT,CAAC;QACJ,CAAC;KAAA;AACH,CAAC;AAtaD,0BAsaC;AAED,SAAgB,iBAAiB,CAC/B,OAA0B,EAC1B,eAAsC,EAAE,EACxC,WAAiD;IAEjD,OAAO,CAAO,IAAY,EAAE,EAAE;QAC5B,MAAM,UAAU,GAAG,OAAO,CAAC,aAAa,CAAC,IAAI,CAAC,CAAC;QAC/C,IAAI,CAAC,UAAU,EAAE;YACf,OAAO,SAAS,CAAC;SAClB;QAED,IAAI,OAA2B,CAAC;QAChC,OAAO,CAAC,IAAI,CACV,UAAU,EACV,CAAC,QAAQ,EAAE,IAAI,EAAE,EAAE;YACjB,IAAI,YAAY,CAAC,IAAI,CAAC,QAAQ,CAAC,EAAE;gBAC/B,OAAO,GAAG,IAAI,CAAC;aAChB;QACH,CAAC,EACD,SAAS,CAAC,uBAAuB,EACjC,SAAS,CAAC,sBAAsB,EAChC,YAAY,CACb,CAAC;QAEF,WAAW,aAAX,WAAW,uBAAX,WAAW,CAAG,UAAU,CAAC,CAAC;QAE1B,OAAO,EAAE,OAAO,EAAE,YAAY,EAAE,EAAE,EAAE,CAAC;IACvC,CAAC,CAAA,CAAC;AACJ,CAAC;AA5BD,8CA4BC"}
1
+ {"version":3,"file":"angular-vite-plugin.js","sourceRoot":"","sources":["../../../../../packages/vite-plugin-angular/src/lib/angular-vite-plugin.ts"],"names":[],"mappings":";;;;AAEA,sCAA6C;AAE7C,iCAAiC;AACjC,6BAA6B;AAE7B,uDAAyD;AACzD,+DAK+B;AAC/B,iCAAkD;AAClD,6DAAiD;AACjD,qFAAwE;AACxE,2CAKwB;AAwBxB;;;;GAIG;AACH,MAAM,YAAY,GAAG,mBAAmB,CAAC;AAEzC,SAAgB,OAAO,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AAC,cAAc,CAAC;yBAC7C;wBACH,CAAC,CAAC,EAAE,CAAC;oBACP,GAAG,aAAa,CAAC,QAAQ,CAAC,cAAc,CAAC,MAAM;iBAChD;gBACD,KAAK,EAAE,aAAa,CAAC,QAAQ,CAAC,cAAc,CAAC,KAAK;gBAClD,iBAAiB,EACf,aAAa,CAAC,QAAQ,CAAC,cAAc,CAAC,iBAAiB;aAC1D,EACD,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,eAAe,CAAC,WAAW,EAAE,CAAC,YAAY,CACtD,EACD,GAAG,EAAE,CAAC,EAAE,CACT,CAAC;QACJ,CAAC;KAAA;AACH,CAAC;AAtaD,0BAsaC;AAED,SAAgB,iBAAiB,CAC/B,OAA0B,EAC1B,eAAsC,EAAE,EACxC,WAAiD;IAEjD,OAAO,CAAO,IAAY,EAAE,EAAE;QAC5B,MAAM,UAAU,GAAG,OAAO,CAAC,aAAa,CAAC,IAAI,CAAC,CAAC;QAC/C,IAAI,CAAC,UAAU,EAAE;YACf,OAAO,SAAS,CAAC;SAClB;QAED,IAAI,OAA2B,CAAC;QAChC,OAAO,CAAC,IAAI,CACV,UAAU,EACV,CAAC,QAAQ,EAAE,IAAI,EAAE,EAAE;YACjB,IAAI,YAAY,CAAC,IAAI,CAAC,QAAQ,CAAC,EAAE;gBAC/B,OAAO,GAAG,IAAI,CAAC;aAChB;QACH,CAAC,EACD,SAAS,CAAC,uBAAuB,EACjC,SAAS,CAAC,sBAAsB,EAChC,YAAY,CACb,CAAC;QAEF,WAAW,aAAX,WAAW,uBAAX,WAAW,CAAG,UAAU,CAAC,CAAC;QAE1B,OAAO,EAAE,OAAO,EAAE,YAAY,EAAE,EAAE,EAAE,CAAC;IACvC,CAAC,CAAA,CAAC;AACJ,CAAC;AA5BD,8CA4BC"}
@@ -6,5 +6,5 @@
6
6
  * found in the LICENSE file at https://angular.io/license
7
7
  */
8
8
  import type { Plugin } from 'esbuild';
9
- import { CompilerPluginOptions } from '@angular-devkit/build-angular/src/builders/browser-esbuild/angular/compiler-plugin';
9
+ import { CompilerPluginOptions } from './utils/devkit';
10
10
  export declare function createCompilerPlugin(pluginOptions: CompilerPluginOptions): Plugin;
@@ -9,262 +9,24 @@
9
9
  Object.defineProperty(exports, "__esModule", { value: true });
10
10
  exports.createCompilerPlugin = void 0;
11
11
  const tslib_1 = require("tslib");
12
- const assert = require("node:assert");
13
- const node_os_1 = require("node:os");
14
- const path = require("node:path");
15
- const node_url_1 = require("node:url");
16
- const ts = require("typescript");
17
- const environment_options_1 = require("@angular-devkit/build-angular/src/utils/environment-options");
18
- const aot_compilation_1 = require("@angular-devkit/build-angular/src/builders/browser-esbuild/angular/aot-compilation");
19
- const javascript_transformer_1 = require("@angular-devkit/build-angular/src/builders/browser-esbuild/javascript-transformer");
20
- /**
21
- * Converts TypeScript Diagnostic related information into an esbuild compatible note object.
22
- * Related information is a subset of a full TypeScript Diagnostic and also used for diagnostic
23
- * notes associated with the main Diagnostic.
24
- * @param info The TypeScript diagnostic relative information to convert.
25
- * @returns An esbuild diagnostic message as a PartialMessage object
26
- */
27
- function convertTypeScriptDiagnosticInfo(info, textPrefix) {
28
- const newLine = (0, node_os_1.platform)() === 'win32' ? '\r\n' : '\n';
29
- let text = ts.flattenDiagnosticMessageText(info.messageText, newLine);
30
- if (textPrefix) {
31
- text = textPrefix + text;
32
- }
33
- const note = { text };
34
- if (info.file) {
35
- note.location = {
36
- file: info.file.fileName,
37
- length: info.length,
38
- };
39
- // Calculate the line/column location and extract the full line text that has the diagnostic
40
- if (info.start) {
41
- const { line, character } = ts.getLineAndCharacterOfPosition(info.file, info.start);
42
- note.location.line = line + 1;
43
- note.location.column = character;
44
- // The start position for the slice is the first character of the error line
45
- const lineStartPosition = ts.getPositionOfLineAndCharacter(info.file, line, 0);
46
- // The end position for the slice is the first character of the next line or the length of
47
- // the entire file if the line is the last line of the file (getPositionOfLineAndCharacter
48
- // will error if a nonexistent line is passed).
49
- const { line: lastLineOfFile } = ts.getLineAndCharacterOfPosition(info.file, info.file.text.length - 1);
50
- const lineEndPosition = line < lastLineOfFile
51
- ? ts.getPositionOfLineAndCharacter(info.file, line + 1, 0)
52
- : info.file.text.length;
53
- note.location.lineText = info.file.text
54
- .slice(lineStartPosition, lineEndPosition)
55
- .trimEnd();
56
- }
57
- }
58
- return note;
59
- }
60
- /**
61
- * Converts a TypeScript Diagnostic message into an esbuild compatible message object.
62
- * @param diagnostic The TypeScript diagnostic to convert.
63
- * @returns An esbuild diagnostic message as a PartialMessage object
64
- */
65
- function convertTypeScriptDiagnostic(diagnostic) {
66
- var _a;
67
- let codePrefix = 'TS';
68
- let code = `${diagnostic.code}`;
69
- if (diagnostic.source === 'ngtsc') {
70
- codePrefix = 'NG';
71
- // Remove `-99` Angular prefix from diagnostic code
72
- code = code.slice(3);
73
- }
74
- const message = Object.assign(Object.assign({}, convertTypeScriptDiagnosticInfo(diagnostic, `${codePrefix}${code}: `)), {
75
- // Store original diagnostic for reference if needed downstream
76
- detail: diagnostic });
77
- if ((_a = diagnostic.relatedInformation) === null || _a === void 0 ? void 0 : _a.length) {
78
- message.notes = diagnostic.relatedInformation.map((info) => convertTypeScriptDiagnosticInfo(info));
79
- }
80
- return message;
81
- }
82
- // eslint-disable-next-line max-lines-per-function
12
+ const devkit_1 = require("./utils/devkit");
83
13
  function createCompilerPlugin(pluginOptions) {
84
14
  return {
85
- name: 'angular-compiler',
86
- // eslint-disable-next-line max-lines-per-function
15
+ name: 'analogjs-angular-esbuild-deps-optimizer-plugin',
87
16
  setup(build) {
88
- var _a, _b;
89
- var _c;
90
17
  return tslib_1.__awaiter(this, void 0, void 0, function* () {
91
- let setupWarnings;
92
- // Initialize a worker pool for JavaScript transformations
93
- const javascriptTransformer = new javascript_transformer_1.JavaScriptTransformer(pluginOptions, environment_options_1.maxWorkers);
94
- const { GLOBAL_DEFS_FOR_TERSER_WITH_AOT, readConfiguration } = yield aot_compilation_1.AotCompilation.loadCompilerCli();
95
- // Setup defines based on the values provided by the Angular compiler-cli
96
- (_a = (_c = build.initialOptions).define) !== null && _a !== void 0 ? _a : (_c.define = {});
97
- for (const [key, value] of Object.entries(GLOBAL_DEFS_FOR_TERSER_WITH_AOT)) {
98
- if (key in build.initialOptions.define) {
99
- // Skip keys that have been manually provided
100
- continue;
101
- }
102
- if (key === 'ngDevMode') {
103
- // ngDevMode is already set based on the builder's script optimization option
104
- continue;
105
- }
106
- // esbuild requires values to be a string (actual strings need to be quoted).
107
- // In this case, all provided values are booleans.
108
- build.initialOptions.define[key] = value.toString();
109
- }
110
- // The tsconfig is loaded in setup instead of in start to allow the esbuild target build option to be modified.
111
- // esbuild build options can only be modified in setup prior to starting the build.
112
- const { options: compilerOptions, rootNames, errors: configurationDiagnostics, } = readConfiguration(pluginOptions.tsconfig, {
113
- noEmitOnError: false,
114
- suppressOutputPathCheck: true,
115
- outDir: undefined,
116
- inlineSources: pluginOptions.sourcemap,
117
- inlineSourceMap: pluginOptions.sourcemap,
118
- sourceMap: false,
119
- mapRoot: undefined,
120
- sourceRoot: undefined,
121
- declaration: false,
122
- declarationMap: false,
123
- allowEmptyCodegenFiles: false,
124
- annotationsAs: 'decorators',
125
- enableResourceInlining: false,
126
- });
127
- if (compilerOptions.target === undefined ||
128
- compilerOptions.target < ts.ScriptTarget.ES2022) {
129
- // If 'useDefineForClassFields' is already defined in the users project leave the value as is.
130
- // Otherwise fallback to false due to https://github.com/microsoft/TypeScript/issues/45995
131
- // which breaks the deprecated `@Effects` NGRX decorator and potentially other existing code as well.
132
- compilerOptions.target = ts.ScriptTarget.ES2022;
133
- (_b = compilerOptions.useDefineForClassFields) !== null && _b !== void 0 ? _b : (compilerOptions.useDefineForClassFields = false);
134
- (setupWarnings !== null && setupWarnings !== void 0 ? setupWarnings : (setupWarnings = [])).push({
135
- text: 'TypeScript compiler options "target" and "useDefineForClassFields" are set to "ES2022" and ' +
136
- '"false" respectively by the Angular CLI.',
137
- location: { file: pluginOptions.tsconfig },
138
- notes: [
139
- {
140
- text: 'To control ECMA version and features use the Browerslist configuration. ' +
141
- 'For more information, see https://angular.io/guide/build#configuring-browser-compatibility',
142
- },
143
- ],
144
- });
145
- }
146
- // The file emitter created during `onStart` that will be used during the build in `onLoad` callbacks for TS files
147
- let fileEmitter;
148
- let compilation;
149
- build.onStart(() => tslib_1.__awaiter(this, void 0, void 0, function* () {
150
- var _d, _e, _f;
151
- const result = {
152
- warnings: setupWarnings,
153
- };
154
- // Reset the setup warnings so that they are only shown during the first build.
155
- setupWarnings = undefined;
156
- // Create Angular compiler host options
157
- const hostOptions = {
158
- fileReplacements: pluginOptions.fileReplacements,
159
- modifiedFiles: (_d = pluginOptions.sourceFileCache) === null || _d === void 0 ? void 0 : _d.modifiedFiles,
160
- sourceFileCache: pluginOptions.sourceFileCache,
161
- transformStylesheet() {
162
- return tslib_1.__awaiter(this, void 0, void 0, function* () {
163
- return null;
164
- });
165
- },
166
- };
167
- // Create new compilation if first build; otherwise, use existing for rebuilds
168
- compilation !== null && compilation !== void 0 ? compilation : (compilation = new aot_compilation_1.AotCompilation());
169
- // Initialize the Angular compilation for the current build.
170
- // In watch mode, previous build state will be reused.
171
- const { affectedFiles } = yield compilation.initialize(rootNames, compilerOptions, hostOptions, configurationDiagnostics);
172
- // Clear affected files from the cache (if present)
173
- if (pluginOptions.sourceFileCache) {
174
- for (const affected of affectedFiles) {
175
- pluginOptions.sourceFileCache.typeScriptFileCache.delete((0, node_url_1.pathToFileURL)(affected.fileName).href);
176
- }
177
- }
178
- // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
179
- for (const diagnostic of compilation.collectDiagnostics()) {
180
- const message = convertTypeScriptDiagnostic(diagnostic);
181
- if (diagnostic.category === ts.DiagnosticCategory.Error) {
182
- ((_e = result.errors) !== null && _e !== void 0 ? _e : (result.errors = [])).push(message);
183
- }
184
- else {
185
- ((_f = result.warnings) !== null && _f !== void 0 ? _f : (result.warnings = [])).push(message);
186
- }
187
- }
188
- fileEmitter = compilation.createFileEmitter();
189
- return result;
190
- }));
191
- build.onLoad({
192
- filter: compilerOptions.allowJs ? /\.[cm]?[jt]sx?$/ : /\.[cm]?tsx?$/,
193
- }, (args) => tslib_1.__awaiter(this, void 0, void 0, function* () {
194
- var _g, _h, _j, _k, _l;
195
- assert.ok(fileEmitter, 'Invalid plugin execution order');
196
- const request = (_h = (_g = pluginOptions.fileReplacements) === null || _g === void 0 ? void 0 : _g[args.path]) !== null && _h !== void 0 ? _h : args.path;
197
- // only process dependencies
198
- if (!request.includes('node_modules')) {
199
- return undefined;
200
- }
201
- // The filename is currently used as a cache key. Since the cache is memory only,
202
- // the options cannot change and do not need to be represented in the key. If the
203
- // cache is later stored to disk, then the options that affect transform output
204
- // would need to be added to the key as well as a check for any change of content.
205
- let contents = (_j = pluginOptions.sourceFileCache) === null || _j === void 0 ? void 0 : _j.typeScriptFileCache.get((0, node_url_1.pathToFileURL)(request).href);
206
- if (contents === undefined) {
207
- const typescriptResult = yield fileEmitter(request);
208
- if (!(typescriptResult === null || typescriptResult === void 0 ? void 0 : typescriptResult.content)) {
209
- // No TS result indicates the file is not part of the TypeScript program.
210
- // If allowJs is enabled and the file is JS then defer to the next load hook.
211
- if (compilerOptions.allowJs && /\.[cm]?js$/.test(request)) {
212
- return undefined;
213
- }
214
- // Otherwise return an error
215
- return {
216
- errors: [
217
- createMissingFileError(request, args.path, (_k = build.initialOptions.absWorkingDir) !== null && _k !== void 0 ? _k : ''),
218
- ],
219
- };
220
- }
221
- contents = yield javascriptTransformer.transformData(request, typescriptResult.content, true /* skipLinker */);
222
- (_l = pluginOptions.sourceFileCache) === null || _l === void 0 ? void 0 : _l.typeScriptFileCache.set((0, node_url_1.pathToFileURL)(request).href, contents);
223
- }
224
- return {
225
- contents,
226
- loader: 'js',
227
- };
228
- }));
18
+ const javascriptTransformer = new devkit_1.JavaScriptTransformer(pluginOptions, 1);
229
19
  build.onLoad({ filter: /\.[cm]?js$/ }, (args) => tslib_1.__awaiter(this, void 0, void 0, function* () {
230
- var _m, _o;
231
- // only process dependencies
232
- if (!args.path.includes('node_modules')) {
233
- return undefined;
234
- }
235
- // The filename is currently used as a cache key. Since the cache is memory only,
236
- // the options cannot change and do not need to be represented in the key. If the
237
- // cache is later stored to disk, then the options that affect transform output
238
- // would need to be added to the key as well as a check for any change of content.
239
- let contents = (_m = pluginOptions.sourceFileCache) === null || _m === void 0 ? void 0 : _m.babelFileCache.get(args.path);
240
- if (contents === undefined) {
241
- contents = yield javascriptTransformer.transformFile(args.path);
242
- (_o = pluginOptions.sourceFileCache) === null || _o === void 0 ? void 0 : _o.babelFileCache.set(args.path, contents);
243
- }
20
+ const contents = yield javascriptTransformer.transformFile(args.path);
244
21
  return {
245
22
  contents,
246
23
  loader: 'js',
247
24
  };
248
25
  }));
26
+ build.onEnd(() => javascriptTransformer.close());
249
27
  });
250
28
  },
251
29
  };
252
30
  }
253
31
  exports.createCompilerPlugin = createCompilerPlugin;
254
- function createMissingFileError(request, original, root) {
255
- const error = {
256
- text: `File '${path.relative(root, request)}' is missing from the TypeScript compilation.`,
257
- notes: [
258
- {
259
- text: `Ensure the file is part of the TypeScript program via the 'files' or 'include' property.`,
260
- },
261
- ],
262
- };
263
- if (request !== original) {
264
- error.notes.push({
265
- text: `File is requested from a file replacement of '${path.relative(root, original)}'.`,
266
- });
267
- }
268
- return error;
269
- }
270
32
  //# sourceMappingURL=compiler-plugin.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"compiler-plugin.js","sourceRoot":"","sources":["../../../../../packages/vite-plugin-angular/src/lib/compiler-plugin.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;;;AASH,sCAAsC;AACtC,qCAAmC;AACnC,kCAAkC;AAClC,uCAAyC;AACzC,iCAAiC;AAEjC,qGAAyF;AAEzF,wHAAoH;AAEpH,8HAA0H;AAE1H;;;;;;GAMG;AACH,SAAS,+BAA+B,CACtC,IAAqC,EACrC,UAAmB;IAEnB,MAAM,OAAO,GAAG,IAAA,kBAAQ,GAAE,KAAK,OAAO,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AAE;wBACvC,OAAO,SAAS,CAAC;qBAClB;oBAED,iFAAiF;oBACjF,iFAAiF;oBACjF,+EAA+E;oBAC/E,kFAAkF;oBAClF,IAAI,QAAQ,GAAG,MAAA,aAAa,CAAC,eAAe,0CAAE,cAAc,CAAC,GAAG,CAC9D,IAAI,CAAC,IAAI,CACV,CAAC;oBAEF,IAAI,QAAQ,KAAK,SAAS,EAAE;wBAC1B,QAAQ,GAAG,MAAM,qBAAqB,CAAC,aAAa,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;wBAChE,MAAA,aAAa,CAAC,eAAe,0CAAE,cAAc,CAAC,GAAG,CAC/C,IAAI,CAAC,IAAI,EACT,QAAQ,CACT,CAAC;qBACH;oBAED,OAAO;wBACL,QAAQ;wBACR,MAAM,EAAE,IAAI;qBACb,CAAC;gBACJ,CAAC,CAAA,CAAC,CAAC;;SACJ;KACF,CAAC;AACJ,CAAC;AA3OD,oDA2OC;AAED,SAAS,sBAAsB,CAC7B,OAAe,EACf,QAAgB,EAChB,IAAY;IAEZ,MAAM,KAAK,GAAG;QACZ,IAAI,EAAE,SAAS,IAAI,CAAC,QAAQ,CAC1B,IAAI,EACJ,OAAO,CACR,+CAA+C;QAChD,KAAK,EAAE;YACL;gBACE,IAAI,EAAE,0FAA0F;aACjG;SACF;KACF,CAAC;IAEF,IAAI,OAAO,KAAK,QAAQ,EAAE;QACxB,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC;YACf,IAAI,EAAE,iDAAiD,IAAI,CAAC,QAAQ,CAClE,IAAI,EACJ,QAAQ,CACT,IAAI;SACN,CAAC,CAAC;KACJ;IAED,OAAO,KAAK,CAAC;AACf,CAAC"}
1
+ {"version":3,"file":"compiler-plugin.js","sourceRoot":"","sources":["../../../../../packages/vite-plugin-angular/src/lib/compiler-plugin.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;;;AAIH,2CAA8E;AAE9E,SAAgB,oBAAoB,CAClC,aAAoC;IAEpC,OAAO;QACL,IAAI,EAAE,gDAAgD;QAChD,KAAK,CAAC,KAAkB;;gBAC5B,MAAM,qBAAqB,GAAG,IAAI,8BAAqB,CAAC,aAAa,EAAE,CAAC,CAAC,CAAC;gBAE1E,KAAK,CAAC,MAAM,CAAC,EAAE,MAAM,EAAE,YAAY,EAAE,EAAE,CAAO,IAAI,EAAE,EAAE;oBACpD,MAAM,QAAQ,GAAG,MAAM,qBAAqB,CAAC,aAAa,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;oBAEtE,OAAO;wBACL,QAAQ;wBACR,MAAM,EAAE,IAAI;qBACb,CAAC;gBACJ,CAAC,CAAA,CAAC,CAAC;gBAEH,KAAK,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC,qBAAqB,CAAC,KAAK,EAAE,CAAC,CAAC;YACnD,CAAC;SAAA;KACF,CAAC;AACJ,CAAC;AApBD,oDAoBC"}
@@ -13,7 +13,9 @@ function resolveStyleUrls(code, id) {
13
13
  if (Array.isArray(styleUrlsGroup) && styleUrlsGroup[0]) {
14
14
  const styleUrls = styleUrlsGroup[0].replace(/(styleUrls|\:|\s|\[|\]|"|')/g, '');
15
15
  const styleUrlPaths = (styleUrls === null || styleUrls === void 0 ? void 0 : styleUrls.split(',')) || [];
16
- return styleUrlPaths.map((styleUrlPath) => (0, path_1.resolve)((0, path_1.dirname)(id), styleUrlPath));
16
+ return styleUrlPaths.map((styleUrlPath) => {
17
+ return `${styleUrlPath}|${(0, path_1.resolve)((0, path_1.dirname)(id), styleUrlPath)}`;
18
+ });
17
19
  }
18
20
  return [];
19
21
  }
@@ -29,7 +31,7 @@ function resolveTemplateUrls(code, id) {
29
31
  templateUrlGroup.forEach((trg) => {
30
32
  const resolvedTemplatePath = trg[1].replace(/templateUrl|\s|'|"|\:|,/g, '');
31
33
  const templateUrlPath = (0, path_1.resolve)((0, path_1.dirname)(id), resolvedTemplatePath);
32
- templateUrlPaths.push(templateUrlPath);
34
+ templateUrlPaths.push(`${resolvedTemplatePath}|${templateUrlPath}`);
33
35
  });
34
36
  }
35
37
  return templateUrlPaths;
@@ -1 +1 @@
1
- {"version":3,"file":"component-resolvers.js","sourceRoot":"","sources":["../../../../../packages/vite-plugin-angular/src/lib/component-resolvers.ts"],"names":[],"mappings":";;;AAAA,+BAAwC;AAExC,MAAM,WAAW,GAAG,+BAA+B,CAAC;AACpD,MAAM,aAAa,GAAG,+BAA+B,CAAC;AAEtD,SAAgB,YAAY,CAAC,IAAY;IACvC,OAAO,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAChC,CAAC;AAFD,oCAEC;AAED,SAAgB,gBAAgB,CAAC,IAAY,EAAE,EAAU;IACvD,MAAM,cAAc,GAAG,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAE9C,IAAI,KAAK,CAAC,OAAO,CAAC,cAAc,CAAC,IAAI,cAAc,CAAC,CAAC,CAAC,EAAE;QACtD,MAAM,SAAS,GAAG,cAAc,CAAC,CAAC,CAAC,CAAC,OAAO,CACzC,8BAA8B,EAC9B,EAAE,CACH,CAAC;QACF,MAAM,aAAa,GAAG,CAAA,SAAS,aAAT,SAAS,uBAAT,SAAS,CAAE,KAAK,CAAC,GAAG,CAAC,KAAI,EAAE,CAAC;QAElD,OAAO,aAAa,CAAC,GAAG,CAAC,CAAC,YAAY,EAAE,EAAE,CACxC,IAAA,cAAO,EAAC,IAAA,cAAO,EAAC,EAAE,CAAC,EAAE,YAAY,CAAC,CACnC,CAAC;KACH;IAED,OAAO,EAAE,CAAC;AACZ,CAAC;AAhBD,4CAgBC;AAED,SAAgB,cAAc,CAAC,IAAY;IACzC,OAAO,IAAI,CAAC,QAAQ,CAAC,cAAc,CAAC,CAAC;AACvC,CAAC;AAFD,wCAEC;AAED,SAAgB,mBAAmB,CAAC,IAAY,EAAE,EAAU;IAC1D,MAAM,gBAAgB,GAAG,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,aAAa,CAAC,CAAC,CAAC;IAClE,MAAM,gBAAgB,GAAa,EAAE,CAAC;IAEtC,IAAI,KAAK,CAAC,OAAO,CAAC,gBAAgB,CAAC,EAAE;QACnC,gBAAgB,CAAC,OAAO,CAAC,CAAC,GAAG,EAAE,EAAE;YAC/B,MAAM,oBAAoB,GAAG,GAAG,CAAC,CAAC,CAAC,CAAC,OAAO,CACzC,0BAA0B,EAC1B,EAAE,CACH,CAAC;YACF,MAAM,eAAe,GAAG,IAAA,cAAO,EAAC,IAAA,cAAO,EAAC,EAAE,CAAC,EAAE,oBAAoB,CAAC,CAAC;YAEnE,gBAAgB,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC;QACzC,CAAC,CAAC,CAAC;KACJ;IAED,OAAO,gBAAgB,CAAC;AAC1B,CAAC;AAjBD,kDAiBC"}
1
+ {"version":3,"file":"component-resolvers.js","sourceRoot":"","sources":["../../../../../packages/vite-plugin-angular/src/lib/component-resolvers.ts"],"names":[],"mappings":";;;AAAA,+BAAwC;AAExC,MAAM,WAAW,GAAG,+BAA+B,CAAC;AACpD,MAAM,aAAa,GAAG,+BAA+B,CAAC;AAEtD,SAAgB,YAAY,CAAC,IAAY;IACvC,OAAO,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAChC,CAAC;AAFD,oCAEC;AAED,SAAgB,gBAAgB,CAAC,IAAY,EAAE,EAAU;IACvD,MAAM,cAAc,GAAG,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAE9C,IAAI,KAAK,CAAC,OAAO,CAAC,cAAc,CAAC,IAAI,cAAc,CAAC,CAAC,CAAC,EAAE;QACtD,MAAM,SAAS,GAAG,cAAc,CAAC,CAAC,CAAC,CAAC,OAAO,CACzC,8BAA8B,EAC9B,EAAE,CACH,CAAC;QACF,MAAM,aAAa,GAAG,CAAA,SAAS,aAAT,SAAS,uBAAT,SAAS,CAAE,KAAK,CAAC,GAAG,CAAC,KAAI,EAAE,CAAC;QAElD,OAAO,aAAa,CAAC,GAAG,CAAC,CAAC,YAAY,EAAE,EAAE;YACxC,OAAO,GAAG,YAAY,IAAI,IAAA,cAAO,EAAC,IAAA,cAAO,EAAC,EAAE,CAAC,EAAE,YAAY,CAAC,EAAE,CAAC;QACjE,CAAC,CAAC,CAAC;KACJ;IAED,OAAO,EAAE,CAAC;AACZ,CAAC;AAhBD,4CAgBC;AAED,SAAgB,cAAc,CAAC,IAAY;IACzC,OAAO,IAAI,CAAC,QAAQ,CAAC,cAAc,CAAC,CAAC;AACvC,CAAC;AAFD,wCAEC;AAED,SAAgB,mBAAmB,CAAC,IAAY,EAAE,EAAU;IAC1D,MAAM,gBAAgB,GAAG,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,aAAa,CAAC,CAAC,CAAC;IAClE,MAAM,gBAAgB,GAAa,EAAE,CAAC;IAEtC,IAAI,KAAK,CAAC,OAAO,CAAC,gBAAgB,CAAC,EAAE;QACnC,gBAAgB,CAAC,OAAO,CAAC,CAAC,GAAG,EAAE,EAAE;YAC/B,MAAM,oBAAoB,GAAG,GAAG,CAAC,CAAC,CAAC,CAAC,OAAO,CACzC,0BAA0B,EAC1B,EAAE,CACH,CAAC;YACF,MAAM,eAAe,GAAG,IAAA,cAAO,EAAC,IAAA,cAAO,EAAC,EAAE,CAAC,EAAE,oBAAoB,CAAC,CAAC;YAEnE,gBAAgB,CAAC,IAAI,CAAC,GAAG,oBAAoB,IAAI,eAAe,EAAE,CAAC,CAAC;QACtE,CAAC,CAAC,CAAC;KACJ;IAED,OAAO,gBAAgB,CAAC;AAC1B,CAAC;AAjBD,kDAiBC"}
@@ -0,0 +1,8 @@
1
+ import { requiresLinking } from '@angular-devkit/build-angular/src/tools/babel/webpack-loader';
2
+ import angularApplicationPreset from '@angular-devkit/build-angular/src/tools/babel/presets/application';
3
+ import { createJitResourceTransformer } from '@angular-devkit/build-angular/src/tools/esbuild/angular/jit-resource-transformer';
4
+ import { CompilerPluginOptions } from '@angular-devkit/build-angular/src/tools/esbuild/angular/compiler-plugin';
5
+ import { JavaScriptTransformer } from '@angular-devkit/build-angular/src/tools/esbuild/javascript-transformer';
6
+ import { SourceFileCache } from '@angular-devkit/build-angular/src/tools/esbuild/angular/compiler-plugin';
7
+ import { loadEsmModule } from '@angular-devkit/build-angular/src/utils/load-esm';
8
+ export { requiresLinking, loadEsmModule, angularApplicationPreset, createJitResourceTransformer, CompilerPluginOptions, JavaScriptTransformer, SourceFileCache, };
@@ -0,0 +1,16 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.SourceFileCache = exports.JavaScriptTransformer = exports.createJitResourceTransformer = exports.angularApplicationPreset = exports.loadEsmModule = exports.requiresLinking = void 0;
4
+ const webpack_loader_1 = require("@angular-devkit/build-angular/src/tools/babel/webpack-loader");
5
+ Object.defineProperty(exports, "requiresLinking", { enumerable: true, get: function () { return webpack_loader_1.requiresLinking; } });
6
+ const application_1 = require("@angular-devkit/build-angular/src/tools/babel/presets/application");
7
+ exports.angularApplicationPreset = application_1.default;
8
+ const jit_resource_transformer_1 = require("@angular-devkit/build-angular/src/tools/esbuild/angular/jit-resource-transformer");
9
+ Object.defineProperty(exports, "createJitResourceTransformer", { enumerable: true, get: function () { return jit_resource_transformer_1.createJitResourceTransformer; } });
10
+ const javascript_transformer_1 = require("@angular-devkit/build-angular/src/tools/esbuild/javascript-transformer");
11
+ Object.defineProperty(exports, "JavaScriptTransformer", { enumerable: true, get: function () { return javascript_transformer_1.JavaScriptTransformer; } });
12
+ const compiler_plugin_1 = require("@angular-devkit/build-angular/src/tools/esbuild/angular/compiler-plugin");
13
+ Object.defineProperty(exports, "SourceFileCache", { enumerable: true, get: function () { return compiler_plugin_1.SourceFileCache; } });
14
+ const load_esm_1 = require("@angular-devkit/build-angular/src/utils/load-esm");
15
+ Object.defineProperty(exports, "loadEsmModule", { enumerable: true, get: function () { return load_esm_1.loadEsmModule; } });
16
+ //# sourceMappingURL=devkit.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"devkit.js","sourceRoot":"","sources":["../../../../../../packages/vite-plugin-angular/src/lib/utils/devkit.ts"],"names":[],"mappings":";;;AAAA,iGAA+F;AAW7F,gGAXO,gCAAe,OAWP;AAVjB,mGAAyG;AAYvG,mCAZK,qBAAwB,CAYL;AAV1B,+HAAgI;AAW9H,6GAXO,uDAA4B,OAWP;AAT9B,mHAA+G;AAW7G,sGAXO,8CAAqB,OAWP;AAVvB,6GAA0G;AAWxG,gGAXO,iCAAe,OAWP;AATjB,+EAAiF;AAI/E,8FAJO,wBAAa,OAIP"}
File without changes
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ //# sourceMappingURL=test-setup.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"test-setup.js","sourceRoot":"","sources":["../../../../packages/vite-plugin-angular/src/test-setup.ts"],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ declare const _default: import("vite").UserConfigExport;
2
+ export default _default;
package/vite.config.js ADDED
@@ -0,0 +1,23 @@
1
+ "use strict";
2
+ /// <reference types="vitest" />
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ const devkit_1 = require("@nx/devkit");
5
+ const vite_1 = require("vite");
6
+ // https://vitejs.dev/config/
7
+ exports.default = (0, vite_1.defineConfig)(({ mode }) => {
8
+ return {
9
+ test: {
10
+ globals: true,
11
+ environment: 'node',
12
+ setupFiles: ['src/test-setup.ts'],
13
+ include: ['**/*.spec.ts'],
14
+ cache: {
15
+ dir: `${(0, devkit_1.offsetFromRoot)('packages/platform/src')}/node_modules/.vitest`,
16
+ },
17
+ },
18
+ define: {
19
+ 'import.meta.vitest': mode !== 'production',
20
+ },
21
+ };
22
+ });
23
+ //# sourceMappingURL=vite.config.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"vite.config.js","sourceRoot":"","sources":["../../../packages/vite-plugin-angular/vite.config.ts"],"names":[],"mappings":";AAAA,gCAAgC;;AAEhC,uCAA4C;AAC5C,+BAAoC;AAEpC,6BAA6B;AAC7B,kBAAe,IAAA,mBAAY,EAAC,CAAC,EAAE,IAAI,EAAE,EAAE,EAAE;IACvC,OAAO;QACL,IAAI,EAAE;YACJ,OAAO,EAAE,IAAI;YACb,WAAW,EAAE,MAAM;YACnB,UAAU,EAAE,CAAC,mBAAmB,CAAC;YACjC,OAAO,EAAE,CAAC,cAAc,CAAC;YACzB,KAAK,EAAE;gBACL,GAAG,EAAE,GAAG,IAAA,uBAAc,EAAC,uBAAuB,CAAC,uBAAuB;aACvE;SACF;QACD,MAAM,EAAE;YACN,oBAAoB,EAAE,IAAI,KAAK,YAAY;SAC5C;KACF,CAAC;AACJ,CAAC,CAAC,CAAC"}