@intlayer/webpack 1.0.1 → 1.2.0
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/dist/cjs/{scripts/startServer.cjs → getEntries.cjs} +19 -14
- package/dist/cjs/getEntries.cjs.map +1 -0
- package/dist/cjs/getEntries.d.ts +5 -0
- package/dist/cjs/index.cjs +0 -7
- package/dist/cjs/index.cjs.map +1 -1
- package/dist/cjs/index.d.ts +0 -2
- package/dist/cjs/utils.cjs +26 -17
- package/dist/cjs/utils.cjs.map +1 -1
- package/dist/cjs/utils.d.ts +5 -2
- package/dist/cjs/webpack-plugin.cjs +4 -134
- package/dist/cjs/webpack-plugin.cjs.map +1 -1
- package/dist/cjs/webpack-plugin.d.ts +1 -11
- package/dist/cjs/webpack.config.cjs +28 -25
- package/dist/cjs/webpack.config.cjs.map +1 -1
- package/dist/esm/getEntries.d.mts +5 -0
- package/dist/esm/getEntries.mjs +17 -0
- package/dist/esm/getEntries.mjs.map +1 -0
- package/dist/esm/index.d.mts +0 -2
- package/dist/esm/index.mjs +0 -4
- package/dist/esm/index.mjs.map +1 -1
- package/dist/esm/utils.d.mts +5 -2
- package/dist/esm/utils.mjs +13 -15
- package/dist/esm/utils.mjs.map +1 -1
- package/dist/esm/webpack-plugin.d.mts +1 -11
- package/dist/esm/webpack-plugin.mjs +4 -134
- package/dist/esm/webpack-plugin.mjs.map +1 -1
- package/dist/esm/webpack.config.mjs +29 -26
- package/dist/esm/webpack.config.mjs.map +1 -1
- package/package.json +11 -15
- package/src/getEntries.ts +19 -0
- package/src/index.ts +2 -12
- package/src/utils.ts +19 -19
- package/src/webpack-plugin.ts +5 -180
- package/src/webpack.config.ts +32 -28
- package/dist/cjs/scripts/bundle.cjs +0 -65
- package/dist/cjs/scripts/bundle.cjs.map +0 -1
- package/dist/cjs/scripts/bundle.d.ts +0 -7
- package/dist/cjs/scripts/index.cjs +0 -25
- package/dist/cjs/scripts/index.cjs.map +0 -1
- package/dist/cjs/scripts/index.d.ts +0 -3
- package/dist/cjs/scripts/startServer.cjs.map +0 -1
- package/dist/cjs/scripts/startServer.d.ts +0 -5
- package/dist/cjs/transpiler/dictionary_to_main/createDictionaryList.cjs +0 -76
- package/dist/cjs/transpiler/dictionary_to_main/createDictionaryList.cjs.map +0 -1
- package/dist/cjs/transpiler/dictionary_to_main/createDictionaryList.d.ts +0 -6
- package/dist/cjs/transpiler/dictionary_to_main/index.cjs +0 -23
- package/dist/cjs/transpiler/dictionary_to_main/index.cjs.map +0 -1
- package/dist/cjs/transpiler/dictionary_to_main/index.d.ts +0 -1
- package/dist/cjs/transpiler/dictionary_to_type/createModuleAugmentation.cjs +0 -87
- package/dist/cjs/transpiler/dictionary_to_type/createModuleAugmentation.cjs.map +0 -1
- package/dist/cjs/transpiler/dictionary_to_type/createModuleAugmentation.d.ts +0 -7
- package/dist/cjs/transpiler/dictionary_to_type/createType.cjs +0 -110
- package/dist/cjs/transpiler/dictionary_to_type/createType.cjs.map +0 -1
- package/dist/cjs/transpiler/dictionary_to_type/createType.d.ts +0 -42
- package/dist/cjs/transpiler/dictionary_to_type/index.cjs +0 -25
- package/dist/cjs/transpiler/dictionary_to_type/index.cjs.map +0 -1
- package/dist/cjs/transpiler/dictionary_to_type/index.d.ts +0 -3
- package/dist/cjs/transpiler/intlater_module_to_dictionary/extractNestedJSON.cjs +0 -45
- package/dist/cjs/transpiler/intlater_module_to_dictionary/extractNestedJSON.cjs.map +0 -1
- package/dist/cjs/transpiler/intlater_module_to_dictionary/extractNestedJSON.d.ts +0 -44
- package/dist/cjs/transpiler/intlater_module_to_dictionary/index.cjs +0 -27
- package/dist/cjs/transpiler/intlater_module_to_dictionary/index.cjs.map +0 -1
- package/dist/cjs/transpiler/intlater_module_to_dictionary/index.d.ts +0 -4
- package/dist/cjs/transpiler/intlater_module_to_dictionary/processModule.cjs +0 -67
- package/dist/cjs/transpiler/intlater_module_to_dictionary/processModule.cjs.map +0 -1
- package/dist/cjs/transpiler/intlater_module_to_dictionary/processModule.d.ts +0 -8
- package/dist/cjs/transpiler/intlater_module_to_dictionary/transpileBundledCode.cjs +0 -96
- package/dist/cjs/transpiler/intlater_module_to_dictionary/transpileBundledCode.cjs.map +0 -1
- package/dist/cjs/transpiler/intlater_module_to_dictionary/transpileBundledCode.d.ts +0 -6
- package/dist/esm/scripts/bundle.d.mts +0 -7
- package/dist/esm/scripts/bundle.mjs +0 -40
- package/dist/esm/scripts/bundle.mjs.map +0 -1
- package/dist/esm/scripts/index.d.mts +0 -3
- package/dist/esm/scripts/index.mjs +0 -3
- package/dist/esm/scripts/index.mjs.map +0 -1
- package/dist/esm/scripts/startServer.d.mts +0 -5
- package/dist/esm/scripts/startServer.mjs +0 -12
- package/dist/esm/scripts/startServer.mjs.map +0 -1
- package/dist/esm/transpiler/dictionary_to_main/createDictionaryList.d.mts +0 -6
- package/dist/esm/transpiler/dictionary_to_main/createDictionaryList.mjs +0 -52
- package/dist/esm/transpiler/dictionary_to_main/createDictionaryList.mjs.map +0 -1
- package/dist/esm/transpiler/dictionary_to_main/index.d.mts +0 -1
- package/dist/esm/transpiler/dictionary_to_main/index.mjs +0 -2
- package/dist/esm/transpiler/dictionary_to_main/index.mjs.map +0 -1
- package/dist/esm/transpiler/dictionary_to_type/createModuleAugmentation.d.mts +0 -7
- package/dist/esm/transpiler/dictionary_to_type/createModuleAugmentation.mjs +0 -62
- package/dist/esm/transpiler/dictionary_to_type/createModuleAugmentation.mjs.map +0 -1
- package/dist/esm/transpiler/dictionary_to_type/createType.d.mts +0 -42
- package/dist/esm/transpiler/dictionary_to_type/createType.mjs +0 -86
- package/dist/esm/transpiler/dictionary_to_type/createType.mjs.map +0 -1
- package/dist/esm/transpiler/dictionary_to_type/index.d.mts +0 -3
- package/dist/esm/transpiler/dictionary_to_type/index.mjs +0 -3
- package/dist/esm/transpiler/dictionary_to_type/index.mjs.map +0 -1
- package/dist/esm/transpiler/intlater_module_to_dictionary/extractNestedJSON.d.mts +0 -44
- package/dist/esm/transpiler/intlater_module_to_dictionary/extractNestedJSON.mjs +0 -21
- package/dist/esm/transpiler/intlater_module_to_dictionary/extractNestedJSON.mjs.map +0 -1
- package/dist/esm/transpiler/intlater_module_to_dictionary/index.d.mts +0 -4
- package/dist/esm/transpiler/intlater_module_to_dictionary/index.mjs +0 -4
- package/dist/esm/transpiler/intlater_module_to_dictionary/index.mjs.map +0 -1
- package/dist/esm/transpiler/intlater_module_to_dictionary/processModule.d.mts +0 -8
- package/dist/esm/transpiler/intlater_module_to_dictionary/processModule.mjs +0 -43
- package/dist/esm/transpiler/intlater_module_to_dictionary/processModule.mjs.map +0 -1
- package/dist/esm/transpiler/intlater_module_to_dictionary/transpileBundledCode.d.mts +0 -6
- package/dist/esm/transpiler/intlater_module_to_dictionary/transpileBundledCode.mjs +0 -72
- package/dist/esm/transpiler/intlater_module_to_dictionary/transpileBundledCode.mjs.map +0 -1
- package/src/scripts/bundle.ts +0 -44
- package/src/scripts/index.ts +0 -2
- package/src/scripts/startServer.ts +0 -14
- package/src/transpiler/dictionary_to_main/createDictionaryList.ts +0 -65
- package/src/transpiler/dictionary_to_main/index.ts +0 -1
- package/src/transpiler/dictionary_to_type/createModuleAugmentation.ts +0 -95
- package/src/transpiler/dictionary_to_type/createType.ts +0 -140
- package/src/transpiler/dictionary_to_type/index.ts +0 -2
- package/src/transpiler/intlater_module_to_dictionary/extractNestedJSON.ts +0 -60
- package/src/transpiler/intlater_module_to_dictionary/index.ts +0 -3
- package/src/transpiler/intlater_module_to_dictionary/processModule.ts +0 -69
- package/src/transpiler/intlater_module_to_dictionary/transpileBundledCode.ts +0 -107
|
@@ -1,15 +1,5 @@
|
|
|
1
|
-
import { Compiler } from 'webpack';
|
|
2
|
-
|
|
3
1
|
declare class IntLayerPlugin {
|
|
4
|
-
|
|
5
|
-
private updatedFiles;
|
|
6
|
-
private addedFiles;
|
|
7
|
-
constructor();
|
|
8
|
-
initDictionaries(): Promise<void>;
|
|
9
|
-
processFilesChanges(): Promise<void>;
|
|
10
|
-
processNewFiles(): Promise<void>;
|
|
11
|
-
detectFileAddedOrRemoved(): Promise<void>;
|
|
12
|
-
apply(compiler: Compiler): void;
|
|
2
|
+
apply(): void;
|
|
13
3
|
}
|
|
14
4
|
|
|
15
5
|
export { IntLayerPlugin };
|
|
@@ -1,138 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
import { sync } from "glob";
|
|
4
|
-
import { DynamicEntryPlugin } from "webpack";
|
|
5
|
-
import { createDictionaryList } from './transpiler/dictionary_to_main/createDictionaryList.mjs';
|
|
6
|
-
import { createModuleAugmentation } from './transpiler/dictionary_to_type/createModuleAugmentation.mjs';
|
|
7
|
-
import { createTypes } from './transpiler/dictionary_to_type/createType.mjs';
|
|
8
|
-
import { transpileBundledCode } from './transpiler/intlater_module_to_dictionary/transpileBundledCode.mjs';
|
|
9
|
-
import { getFileHash } from './utils.mjs';
|
|
10
|
-
const getRelativePath = (filePath) => relative(baseDir, filePath);
|
|
11
|
-
const getBundledFilePathFromIntlayerModule = (filePath) => {
|
|
12
|
-
const hash = getFileHash(filePath);
|
|
13
|
-
return `${bundleDir}/${hash}${bundleFileExtension}`;
|
|
14
|
-
};
|
|
15
|
-
const { content } = getConfiguration();
|
|
16
|
-
const { bundleDir, baseDir, bundleFileExtension, watchedFilesPatternWithPath } = content;
|
|
1
|
+
import { watch } from "@intlayer/chokidar";
|
|
2
|
+
const persistent = process.env.NODE_ENV === "development";
|
|
17
3
|
class IntLayerPlugin {
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
addedFiles;
|
|
21
|
-
constructor() {
|
|
22
|
-
this.managedFiles = /* @__PURE__ */ new Set();
|
|
23
|
-
this.updatedFiles = /* @__PURE__ */ new Set();
|
|
24
|
-
this.addedFiles = /* @__PURE__ */ new Set();
|
|
25
|
-
}
|
|
26
|
-
// function to initialize the dictionaries
|
|
27
|
-
async initDictionaries() {
|
|
28
|
-
const outputFiles = [...this.managedFiles].map(
|
|
29
|
-
(file) => resolve(bundleDir, file)
|
|
30
|
-
);
|
|
31
|
-
const dictionaries = await transpileBundledCode(outputFiles) ?? [];
|
|
32
|
-
console.info(
|
|
33
|
-
`Dictionaries:
|
|
34
|
-
${dictionaries.map(getRelativePath).join("\n")}`
|
|
35
|
-
);
|
|
36
|
-
console.info("Building TypeScript types...");
|
|
37
|
-
createTypes(dictionaries);
|
|
38
|
-
console.info("Building type index...");
|
|
39
|
-
createModuleAugmentation();
|
|
40
|
-
console.info("Building main...");
|
|
41
|
-
createDictionaryList();
|
|
42
|
-
}
|
|
43
|
-
// function to process when intlayer module files content are changed
|
|
44
|
-
async processFilesChanges() {
|
|
45
|
-
const dictionaries = await transpileBundledCode([...this.updatedFiles]) ?? [];
|
|
46
|
-
console.info(
|
|
47
|
-
`Updated dictionaries:
|
|
48
|
-
${dictionaries.map(getRelativePath).join("\n")}`
|
|
49
|
-
);
|
|
50
|
-
console.info("Updating TypeScript types...");
|
|
51
|
-
createTypes(dictionaries);
|
|
52
|
-
this.updatedFiles.clear();
|
|
53
|
-
}
|
|
54
|
-
// function to process when new intlayer module is detected
|
|
55
|
-
async processNewFiles() {
|
|
56
|
-
const dictionaries = await transpileBundledCode([...this.addedFiles]) ?? [];
|
|
57
|
-
console.info(
|
|
58
|
-
`New dictionaries:
|
|
59
|
-
${dictionaries.map(getRelativePath).join("\n")}`
|
|
60
|
-
);
|
|
61
|
-
console.info("Building TypeScript types...");
|
|
62
|
-
createTypes(dictionaries);
|
|
63
|
-
console.info("Building type index...");
|
|
64
|
-
createModuleAugmentation();
|
|
65
|
-
console.info("Building main...");
|
|
66
|
-
createDictionaryList();
|
|
67
|
-
this.managedFiles = /* @__PURE__ */ new Set([...this.managedFiles, ...this.addedFiles]);
|
|
68
|
-
this.addedFiles.clear();
|
|
69
|
-
}
|
|
70
|
-
async detectFileAddedOrRemoved() {
|
|
71
|
-
const filesFound = [];
|
|
72
|
-
for (const pattern of watchedFilesPatternWithPath) {
|
|
73
|
-
sync(pattern).map((file) => filesFound.push(file));
|
|
74
|
-
}
|
|
75
|
-
const newFiles = new Set(
|
|
76
|
-
filesFound.filter((x) => !this.managedFiles.has(x))
|
|
77
|
-
);
|
|
78
|
-
const removedFiles = new Set(
|
|
79
|
-
[...this.managedFiles].filter((x) => !filesFound.includes(x))
|
|
80
|
-
);
|
|
81
|
-
if (
|
|
82
|
-
// Check if there is new files
|
|
83
|
-
newFiles.size > 0
|
|
84
|
-
) {
|
|
85
|
-
console.info("New files:", [...newFiles]);
|
|
86
|
-
this.addedFiles = newFiles;
|
|
87
|
-
await this.processNewFiles();
|
|
88
|
-
}
|
|
89
|
-
if (
|
|
90
|
-
// Check if there is removed files
|
|
91
|
-
removedFiles.size > 0
|
|
92
|
-
) {
|
|
93
|
-
console.info("Removed files:", [...removedFiles]);
|
|
94
|
-
this.managedFiles = new Set(
|
|
95
|
-
[...this.managedFiles].filter((x) => !removedFiles.has(x))
|
|
96
|
-
);
|
|
97
|
-
}
|
|
98
|
-
if (this.updatedFiles.size > 0) {
|
|
99
|
-
await this.processFilesChanges();
|
|
100
|
-
}
|
|
101
|
-
}
|
|
102
|
-
apply(compiler) {
|
|
103
|
-
compiler.hooks.entryOption.tap("EntryOptionPlugin", (context, entry) => {
|
|
104
|
-
if (typeof entry === "function") {
|
|
105
|
-
new DynamicEntryPlugin(context, entry).apply(compiler);
|
|
106
|
-
}
|
|
107
|
-
return true;
|
|
108
|
-
});
|
|
109
|
-
compiler.hooks.afterEmit.tapAsync(
|
|
110
|
-
"IntLayerPlugin - Process dictionaries",
|
|
111
|
-
async (compilation, callback) => {
|
|
112
|
-
const currentEmitFiles = new Set(Object.keys(compilation.assets));
|
|
113
|
-
if (
|
|
114
|
-
// Check if this first load
|
|
115
|
-
!this.managedFiles.size
|
|
116
|
-
) {
|
|
117
|
-
this.managedFiles = currentEmitFiles;
|
|
118
|
-
await this.initDictionaries();
|
|
119
|
-
}
|
|
120
|
-
await this.detectFileAddedOrRemoved();
|
|
121
|
-
callback();
|
|
122
|
-
}
|
|
123
|
-
);
|
|
124
|
-
compiler.hooks.watchRun.tap(
|
|
125
|
-
"IntLayerPlugin - Change detection",
|
|
126
|
-
(compilation) => {
|
|
127
|
-
if (compilation.modifiedFiles) {
|
|
128
|
-
const updatedFiles = Array.from(compilation.modifiedFiles);
|
|
129
|
-
const outputFileNames = updatedFiles.map(
|
|
130
|
-
getBundledFilePathFromIntlayerModule
|
|
131
|
-
);
|
|
132
|
-
this.updatedFiles = new Set(outputFileNames);
|
|
133
|
-
}
|
|
134
|
-
}
|
|
135
|
-
);
|
|
4
|
+
apply() {
|
|
5
|
+
watch({ persistent });
|
|
136
6
|
}
|
|
137
7
|
}
|
|
138
8
|
export {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/webpack-plugin.ts"],"sourcesContent":["import {
|
|
1
|
+
{"version":3,"sources":["../../src/webpack-plugin.ts"],"sourcesContent":["import { watch } from '@intlayer/chokidar';\n\n// Watch mode or on time build\nconst persistent = process.env.NODE_ENV === 'development';\n\nexport class IntLayerPlugin {\n apply(): void {\n watch({ persistent });\n }\n}\n"],"mappings":"AAAA,SAAS,aAAa;AAGtB,MAAM,aAAa,QAAQ,IAAI,aAAa;AAErC,MAAM,eAAe;AAAA,EAC1B,QAAc;AACZ,UAAM,EAAE,WAAW,CAAC;AAAA,EACtB;AACF;","names":[]}
|
|
@@ -1,20 +1,13 @@
|
|
|
1
1
|
import { join } from "path";
|
|
2
2
|
import { getConfiguration } from "@intlayer/config";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
3
|
+
import { getEntries } from './getEntries.mjs';
|
|
4
|
+
import { defineDirname } from './utils.mjs';
|
|
5
5
|
import { IntLayerPlugin } from './webpack-plugin.mjs';
|
|
6
6
|
const { content } = getConfiguration({
|
|
7
|
-
verbose:
|
|
7
|
+
verbose: false
|
|
8
8
|
});
|
|
9
|
-
const {
|
|
10
|
-
|
|
11
|
-
(obj, el) => {
|
|
12
|
-
const hash = getFileHash(el);
|
|
13
|
-
obj[hash] = el;
|
|
14
|
-
return obj;
|
|
15
|
-
},
|
|
16
|
-
{}
|
|
17
|
-
);
|
|
9
|
+
const { fileExtensions } = content;
|
|
10
|
+
defineDirname();
|
|
18
11
|
const devServerConfig = {
|
|
19
12
|
// Enable hot module replacement
|
|
20
13
|
hot: true,
|
|
@@ -35,9 +28,7 @@ const devServerConfig = {
|
|
|
35
28
|
writeToDisk: true
|
|
36
29
|
},
|
|
37
30
|
// Content base
|
|
38
|
-
static: {
|
|
39
|
-
directory: bundleDir
|
|
40
|
-
}
|
|
31
|
+
static: {}
|
|
41
32
|
};
|
|
42
33
|
const webpackConfig = {
|
|
43
34
|
// Define the environment mode (development or production)
|
|
@@ -46,17 +37,16 @@ const webpackConfig = {
|
|
|
46
37
|
// Entry point of the application
|
|
47
38
|
target: "node",
|
|
48
39
|
// Specifies the target environment
|
|
49
|
-
entry:
|
|
40
|
+
entry: getEntries,
|
|
50
41
|
output: {
|
|
51
42
|
clean: true,
|
|
52
43
|
// Clean the output directory before emit
|
|
53
44
|
library: "IntlLayerContent",
|
|
54
45
|
libraryTarget: "umd",
|
|
55
|
-
filename: `[name]
|
|
56
|
-
path: bundleDir
|
|
46
|
+
filename: `[name].bundle.js`
|
|
57
47
|
},
|
|
58
48
|
cache: false,
|
|
59
|
-
|
|
49
|
+
devtool: "source-map",
|
|
60
50
|
// stats: {
|
|
61
51
|
// preset: 'errors-only',
|
|
62
52
|
// warnings: false,
|
|
@@ -67,7 +57,7 @@ const webpackConfig = {
|
|
|
67
57
|
extensions: [".ts", ".js", ".json", ".wasm", ".ts", ".tsx", ".mjs", ".cjs"],
|
|
68
58
|
modules: [
|
|
69
59
|
// To find the loader module
|
|
70
|
-
join(__dirname, "..", "node_modules"),
|
|
60
|
+
join(globalThis.__dirname, "..", "node_modules"),
|
|
71
61
|
// In the project node_modules
|
|
72
62
|
join(process.cwd(), "node_modules"),
|
|
73
63
|
// In the project node_modules
|
|
@@ -102,14 +92,27 @@ const webpackConfig = {
|
|
|
102
92
|
)
|
|
103
93
|
// Or via another project by importing intlayer
|
|
104
94
|
]
|
|
105
|
-
// roots: [
|
|
106
|
-
// join(process.cwd()), // Project context
|
|
107
|
-
// join(process.cwd(), '@intlayer/webpack'), // Or via CLI in another project
|
|
108
|
-
// join(process.cwd(), 'intlayer', '@intlayer/webpack'), // Or via CLI in another project
|
|
109
|
-
// ],
|
|
110
95
|
},
|
|
111
96
|
module: {
|
|
112
97
|
rules: [
|
|
98
|
+
{
|
|
99
|
+
// Rule for .content.ts files
|
|
100
|
+
test: new RegExp(`(${fileExtensions.join("|")})$`),
|
|
101
|
+
use: [
|
|
102
|
+
{
|
|
103
|
+
// Transpile with esbuild-loader
|
|
104
|
+
loader: "esbuild-loader",
|
|
105
|
+
options: {
|
|
106
|
+
// JavaScript version to compile to
|
|
107
|
+
target: "es2015"
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
// {
|
|
111
|
+
// // Custom loader to process the transpiled code
|
|
112
|
+
// loader: resolve('./intlayer-loader'),
|
|
113
|
+
// },
|
|
114
|
+
]
|
|
115
|
+
},
|
|
113
116
|
{
|
|
114
117
|
test: /\.node$/,
|
|
115
118
|
loader: "node-loader"
|
|
@@ -117,7 +120,7 @@ const webpackConfig = {
|
|
|
117
120
|
// Use esbuild to compile JavaScript & TypeScript
|
|
118
121
|
{
|
|
119
122
|
// Match `.js`, `.jsx`, `.ts` or `.tsx` files
|
|
120
|
-
test: /\.
|
|
123
|
+
test: /\.(jsx|js|ts|tsx|mjs|cjs)?$/,
|
|
121
124
|
loader: "esbuild-loader",
|
|
122
125
|
options: {
|
|
123
126
|
// JavaScript version to compile to
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/webpack.config.ts"],"sourcesContent":["import { join } from 'path';\nimport { getConfiguration } from '@intlayer/config';\nimport
|
|
1
|
+
{"version":3,"sources":["../../src/webpack.config.ts"],"sourcesContent":["import { join } from 'path';\nimport { getConfiguration } from '@intlayer/config';\nimport type { Configuration as WebPackConfiguration } from 'webpack';\nimport type { Configuration as DevServerConfiguration } from 'webpack-dev-server';\nimport { getEntries } from './getEntries';\nimport { defineDirname } from './utils';\nimport { IntLayerPlugin } from './webpack-plugin';\n\nconst { content } = getConfiguration({\n verbose: false,\n});\nconst { fileExtensions } = content;\n\n/**\n * Set the __dirname global variable to make the config work in both ESM and CJS environments\n */\ndefineDirname();\n\n// For web interface\nexport const devServerConfig: DevServerConfiguration = {\n // Enable hot module replacement\n hot: true,\n // Open the browser\n open: false,\n liveReload: false,\n\n // Enable compression\n compress: true,\n\n // History API fallback\n historyApiFallback: false,\n\n // Host and port\n host: 'localhost',\n port: 8080,\n\n watchFiles: './src/', // watchedFilesPatternWithPath,\n\n devMiddleware: {\n // Enable write to disk to reuse the output\n writeToDisk: true,\n },\n\n // Content base\n static: {},\n};\n\nexport const webpackConfig: WebPackConfiguration = {\n // Define the environment mode (development or production)\n mode: 'production', // or 'production'\n // Entry point of the application\n target: 'node', // Specifies the target environment\n\n entry: getEntries,\n output: {\n clean: true, // Clean the output directory before emit\n library: 'IntlLayerContent',\n libraryTarget: 'umd',\n filename: `[name].bundle.js`,\n },\n\n cache: false,\n\n devtool: 'source-map',\n\n // stats: {\n // preset: 'errors-only',\n // warnings: false,\n // },\n ignoreWarnings: [/./],\n resolve: {\n // Resolve TypeScript, JavaScript and JSON files\n extensions: ['.ts', '.js', '.json', '.wasm', '.ts', '.tsx', '.mjs', '.cjs'],\n modules: [\n // To find the loader module\n join(globalThis.__dirname, '..', 'node_modules'), // In the project node_modules\n join(process.cwd(), 'node_modules'), // In the project node_modules\n join(process.cwd(), 'node_modules', 'intlayer-cli', 'node_modules'), // Or via another project by importing intlayer\n join(\n process.cwd(),\n 'node_modules',\n 'intlayer-cli',\n 'node_modules',\n '@intlayer/webpack',\n 'node_modules'\n ), // Or via another project by importing intlayer\n ],\n },\n\n resolveLoader: {\n // Configure how Webpack finds `loader` modules.\n modules: [\n // To find the loader module\n join(process.cwd(), 'node_modules'), // In the project node_modules\n join(process.cwd(), 'node_modules', '@intlayer/webpack', 'node_modules'), // Or via another project by importing @intlayer/webpack\n join(\n process.cwd(),\n 'node_modules',\n 'intlayer-cli',\n 'node_modules',\n '@intlayer/webpack',\n 'node_modules'\n ), // Or via another project by importing intlayer\n ],\n },\n\n module: {\n rules: [\n {\n // Rule for .content.ts files\n test: new RegExp(`(${fileExtensions.join('|')})$`),\n use: [\n {\n // Transpile with esbuild-loader\n loader: 'esbuild-loader',\n options: {\n // JavaScript version to compile to\n target: 'es2015',\n },\n },\n // {\n // // Custom loader to process the transpiled code\n // loader: resolve('./intlayer-loader'),\n // },\n ],\n },\n {\n test: /\\.node$/,\n loader: 'node-loader',\n },\n // Use esbuild to compile JavaScript & TypeScript\n {\n // Match `.js`, `.jsx`, `.ts` or `.tsx` files\n test: /\\.(jsx|js|ts|tsx|mjs|cjs)?$/,\n loader: 'esbuild-loader',\n options: {\n // JavaScript version to compile to\n target: 'es2015',\n },\n },\n\n // JSON files are supported natively by Webpack 5, no specific loader required\n ],\n },\n devServer: devServerConfig,\n\n plugins: [\n new IntLayerPlugin(),\n // new HotModuleReplacementPlugin()\n ],\n};\n\nexport default webpackConfig;\n"],"mappings":"AAAA,SAAS,YAAY;AACrB,SAAS,wBAAwB;AAGjC,SAAS,kBAAkB;AAC3B,SAAS,qBAAqB;AAC9B,SAAS,sBAAsB;AAE/B,MAAM,EAAE,QAAQ,IAAI,iBAAiB;AAAA,EACnC,SAAS;AACX,CAAC;AACD,MAAM,EAAE,eAAe,IAAI;AAK3B,cAAc;AAGP,MAAM,kBAA0C;AAAA;AAAA,EAErD,KAAK;AAAA;AAAA,EAEL,MAAM;AAAA,EACN,YAAY;AAAA;AAAA,EAGZ,UAAU;AAAA;AAAA,EAGV,oBAAoB;AAAA;AAAA,EAGpB,MAAM;AAAA,EACN,MAAM;AAAA,EAEN,YAAY;AAAA;AAAA,EAEZ,eAAe;AAAA;AAAA,IAEb,aAAa;AAAA,EACf;AAAA;AAAA,EAGA,QAAQ,CAAC;AACX;AAEO,MAAM,gBAAsC;AAAA;AAAA,EAEjD,MAAM;AAAA;AAAA;AAAA,EAEN,QAAQ;AAAA;AAAA,EAER,OAAO;AAAA,EACP,QAAQ;AAAA,IACN,OAAO;AAAA;AAAA,IACP,SAAS;AAAA,IACT,eAAe;AAAA,IACf,UAAU;AAAA,EACZ;AAAA,EAEA,OAAO;AAAA,EAEP,SAAS;AAAA;AAAA;AAAA;AAAA;AAAA,EAMT,gBAAgB,CAAC,GAAG;AAAA,EACpB,SAAS;AAAA;AAAA,IAEP,YAAY,CAAC,OAAO,OAAO,SAAS,SAAS,OAAO,QAAQ,QAAQ,MAAM;AAAA,IAC1E,SAAS;AAAA;AAAA,MAEP,KAAK,WAAW,WAAW,MAAM,cAAc;AAAA;AAAA,MAC/C,KAAK,QAAQ,IAAI,GAAG,cAAc;AAAA;AAAA,MAClC,KAAK,QAAQ,IAAI,GAAG,gBAAgB,gBAAgB,cAAc;AAAA;AAAA,MAClE;AAAA,QACE,QAAQ,IAAI;AAAA,QACZ;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,MACF;AAAA;AAAA,IACF;AAAA,EACF;AAAA,EAEA,eAAe;AAAA;AAAA,IAEb,SAAS;AAAA;AAAA,MAEP,KAAK,QAAQ,IAAI,GAAG,cAAc;AAAA;AAAA,MAClC,KAAK,QAAQ,IAAI,GAAG,gBAAgB,qBAAqB,cAAc;AAAA;AAAA,MACvE;AAAA,QACE,QAAQ,IAAI;AAAA,QACZ;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,MACF;AAAA;AAAA,IACF;AAAA,EACF;AAAA,EAEA,QAAQ;AAAA,IACN,OAAO;AAAA,MACL;AAAA;AAAA,QAEE,MAAM,IAAI,OAAO,IAAI,eAAe,KAAK,GAAG,CAAC,IAAI;AAAA,QACjD,KAAK;AAAA,UACH;AAAA;AAAA,YAEE,QAAQ;AAAA,YACR,SAAS;AAAA;AAAA,cAEP,QAAQ;AAAA,YACV;AAAA,UACF;AAAA;AAAA;AAAA;AAAA;AAAA,QAKF;AAAA,MACF;AAAA,MACA;AAAA,QACE,MAAM;AAAA,QACN,QAAQ;AAAA,MACV;AAAA;AAAA,MAEA;AAAA;AAAA,QAEE,MAAM;AAAA,QACN,QAAQ;AAAA,QACR,SAAS;AAAA;AAAA,UAEP,QAAQ;AAAA,QACV;AAAA,MACF;AAAA;AAAA,IAGF;AAAA,EACF;AAAA,EACA,WAAW;AAAA,EAEX,SAAS;AAAA,IACP,IAAI,eAAe;AAAA;AAAA,EAErB;AACF;AAEA,IAAO,yBAAQ;","names":[]}
|
package/package.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@intlayer/webpack",
|
|
3
|
-
"version": "1.0
|
|
3
|
+
"version": "1.2.0",
|
|
4
4
|
"private": false,
|
|
5
|
-
"description": "Webpack application for IntLayer -
|
|
5
|
+
"description": "Webpack application for IntLayer - Transpile Intlayer declaration files into dictionaries using webpack.",
|
|
6
6
|
"keywords": [
|
|
7
7
|
"intlayer",
|
|
8
8
|
"webpack",
|
|
@@ -46,33 +46,29 @@
|
|
|
46
46
|
"./package.json"
|
|
47
47
|
],
|
|
48
48
|
"dependencies": {
|
|
49
|
+
"chokidar": "^3.6.0",
|
|
49
50
|
"crypto-js": "^4.2.0",
|
|
50
51
|
"esbuild": "^0.20.2",
|
|
51
52
|
"esbuild-loader": "^4.1.0",
|
|
52
|
-
"glob": "^10.3.
|
|
53
|
+
"glob": "^10.3.12",
|
|
53
54
|
"node-loader": "^2.0.0",
|
|
54
55
|
"rimraf": "5.0.5",
|
|
55
56
|
"util": "^0.12.5",
|
|
56
57
|
"webpack": "^5.91.0",
|
|
57
58
|
"webpack-cli": "^5.1.4",
|
|
58
59
|
"webpack-dev-server": "^5.0.4",
|
|
59
|
-
"
|
|
60
|
-
"@intlayer/cli": "^1.0
|
|
61
|
-
"@intlayer/config": "^1.0
|
|
62
|
-
"@intlayer/core": "^1.0
|
|
60
|
+
"@intlayer/chokidar": "^1.2.0",
|
|
61
|
+
"@intlayer/cli": "^1.2.0",
|
|
62
|
+
"@intlayer/config": "^1.2.0",
|
|
63
|
+
"@intlayer/core": "^1.2.0",
|
|
64
|
+
"intlayer": "^1.2.0"
|
|
63
65
|
},
|
|
64
66
|
"devDependencies": {
|
|
65
|
-
"@changesets/changelog-github": "0.5.0",
|
|
66
67
|
"@changesets/cli": "2.27.1",
|
|
67
68
|
"@types/crypto-js": "^4.2.2",
|
|
68
|
-
"@types/node": "^20.
|
|
69
|
-
"@types/uuid": "^9.0.8",
|
|
70
|
-
"@types/webpack-watch-files-plugin": "^1.1.3",
|
|
71
|
-
"@types/yargs": "^17.0.32",
|
|
72
|
-
"node-polyfill-webpack-plugin": "^3.0.0",
|
|
69
|
+
"@types/node": "^20.12.7",
|
|
73
70
|
"tsup": "^8.0.2",
|
|
74
|
-
"typescript": "^5.
|
|
75
|
-
"webpack-watch-files-plugin": "^1.2.1",
|
|
71
|
+
"typescript": "^5.4.5",
|
|
76
72
|
"@utils/eslint-config": "^1.0.1",
|
|
77
73
|
"@utils/ts-config": "^1.0.1"
|
|
78
74
|
},
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { getConfiguration } from '@intlayer/config';
|
|
2
|
+
import { sync } from 'glob';
|
|
3
|
+
import type { EntryObject } from 'webpack';
|
|
4
|
+
import { getFileHash } from './utils';
|
|
5
|
+
|
|
6
|
+
const { content } = getConfiguration();
|
|
7
|
+
const { watchedFilesPatternWithPath } = content;
|
|
8
|
+
|
|
9
|
+
export const getEntries = (): EntryObject =>
|
|
10
|
+
sync(watchedFilesPatternWithPath).reduce((obj, el) => {
|
|
11
|
+
const hash = getFileHash(el);
|
|
12
|
+
|
|
13
|
+
obj[`intlayer-content/${hash}`] = {
|
|
14
|
+
import: el,
|
|
15
|
+
dependOn: undefined,
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
return obj;
|
|
19
|
+
}, {} as EntryObject);
|
package/src/index.ts
CHANGED
|
@@ -1,12 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
import { devServerConfig, webpackConfig } from './webpack.config';
|
|
4
|
-
|
|
5
|
-
export {
|
|
6
|
-
bundle,
|
|
7
|
-
watch,
|
|
8
|
-
startServer,
|
|
9
|
-
devServerConfig,
|
|
10
|
-
webpackConfig,
|
|
11
|
-
IntLayerPlugin,
|
|
12
|
-
};
|
|
1
|
+
export { IntLayerPlugin } from './webpack-plugin';
|
|
2
|
+
export { devServerConfig, webpackConfig } from './webpack.config';
|
package/src/utils.ts
CHANGED
|
@@ -1,26 +1,26 @@
|
|
|
1
|
-
import
|
|
1
|
+
import path from 'path';
|
|
2
|
+
import { fileURLToPath } from 'url';
|
|
3
|
+
import crypto from 'crypto-js';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Set the __dirname global variable to make the config work in both ESM and CJS environments
|
|
7
|
+
*/
|
|
8
|
+
export const defineDirname = () => {
|
|
9
|
+
const isESModule = typeof import.meta.url === 'string';
|
|
10
|
+
|
|
11
|
+
const filename = isESModule
|
|
12
|
+
? fileURLToPath(import.meta.url)
|
|
13
|
+
: require('url').pathToFileURL(__filename).toString();
|
|
14
|
+
|
|
15
|
+
globalThis.__filename = globalThis.__filename ?? filename;
|
|
16
|
+
globalThis.__dirname = globalThis.__dirname ?? path.dirname(__filename);
|
|
17
|
+
};
|
|
2
18
|
|
|
3
19
|
export const getFileHash = (filePath: string) => {
|
|
4
|
-
const hash = SHA3(filePath);
|
|
20
|
+
const hash = crypto.SHA3(filePath);
|
|
5
21
|
|
|
6
22
|
return hash
|
|
7
|
-
.toString(enc.Base64)
|
|
23
|
+
.toString(crypto.enc.Base64)
|
|
8
24
|
.replace(/[^A-Z\d]/gi, '')
|
|
9
25
|
.substring(0, 20);
|
|
10
26
|
};
|
|
11
|
-
|
|
12
|
-
export const transformToCamelCase = (string: string): string => {
|
|
13
|
-
// Split the string into words using a regex that finds spaces, hyphens, and underscores
|
|
14
|
-
const words = string.split(/[\s\-_]+/);
|
|
15
|
-
|
|
16
|
-
// Transform each word except the first to have its first letter uppercase
|
|
17
|
-
const camelCasedWords = words.map((word, index) => {
|
|
18
|
-
if (index === 0) {
|
|
19
|
-
return word[0].toUpperCase() + word.slice(1);
|
|
20
|
-
}
|
|
21
|
-
return word.charAt(0).toUpperCase() + word.slice(1);
|
|
22
|
-
});
|
|
23
|
-
|
|
24
|
-
// Join the words back together
|
|
25
|
-
return camelCasedWords.join('');
|
|
26
|
-
};
|
package/src/webpack-plugin.ts
CHANGED
|
@@ -1,185 +1,10 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { getConfiguration } from '@intlayer/config';
|
|
3
|
-
import { sync } from 'glob';
|
|
4
|
-
import { DynamicEntryPlugin, type Compiler } from 'webpack';
|
|
5
|
-
import { createDictionaryList } from './transpiler/dictionary_to_main/createDictionaryList';
|
|
6
|
-
import { createModuleAugmentation } from './transpiler/dictionary_to_type/createModuleAugmentation';
|
|
7
|
-
import { createTypes } from './transpiler/dictionary_to_type/createType';
|
|
8
|
-
import { transpileBundledCode } from './transpiler/intlater_module_to_dictionary/transpileBundledCode';
|
|
9
|
-
import { getFileHash } from './utils';
|
|
1
|
+
import { watch } from '@intlayer/chokidar';
|
|
10
2
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
const getBundledFilePathFromIntlayerModule = (filePath: string): string => {
|
|
14
|
-
const hash = getFileHash(filePath);
|
|
15
|
-
|
|
16
|
-
return `${bundleDir}/${hash}${bundleFileExtension}`;
|
|
17
|
-
};
|
|
18
|
-
|
|
19
|
-
const { content } = getConfiguration();
|
|
20
|
-
const { bundleDir, baseDir, bundleFileExtension, watchedFilesPatternWithPath } =
|
|
21
|
-
content;
|
|
3
|
+
// Watch mode or on time build
|
|
4
|
+
const persistent = process.env.NODE_ENV === 'development';
|
|
22
5
|
|
|
23
6
|
export class IntLayerPlugin {
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
private addedFiles: Set<string>;
|
|
27
|
-
|
|
28
|
-
constructor() {
|
|
29
|
-
this.managedFiles = new Set();
|
|
30
|
-
this.updatedFiles = new Set();
|
|
31
|
-
this.addedFiles = new Set();
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
// function to initialize the dictionaries
|
|
35
|
-
public async initDictionaries() {
|
|
36
|
-
const outputFiles = [...this.managedFiles].map((file) =>
|
|
37
|
-
resolve(bundleDir, file)
|
|
38
|
-
);
|
|
39
|
-
|
|
40
|
-
const dictionaries = (await transpileBundledCode(outputFiles)) ?? [];
|
|
41
|
-
|
|
42
|
-
console.info(
|
|
43
|
-
`Dictionaries: \n ${dictionaries.map(getRelativePath).join('\n')}`
|
|
44
|
-
);
|
|
45
|
-
|
|
46
|
-
console.info('Building TypeScript types...');
|
|
47
|
-
createTypes(dictionaries);
|
|
48
|
-
|
|
49
|
-
console.info('Building type index...');
|
|
50
|
-
createModuleAugmentation();
|
|
51
|
-
|
|
52
|
-
console.info('Building main...');
|
|
53
|
-
createDictionaryList();
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
// function to process when intlayer module files content are changed
|
|
57
|
-
public async processFilesChanges() {
|
|
58
|
-
const dictionaries =
|
|
59
|
-
(await transpileBundledCode([...this.updatedFiles])) ?? [];
|
|
60
|
-
|
|
61
|
-
console.info(
|
|
62
|
-
`Updated dictionaries: \n ${dictionaries.map(getRelativePath).join('\n')}`
|
|
63
|
-
);
|
|
64
|
-
|
|
65
|
-
console.info('Updating TypeScript types...');
|
|
66
|
-
createTypes(dictionaries);
|
|
67
|
-
|
|
68
|
-
this.updatedFiles.clear();
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
// function to process when new intlayer module is detected
|
|
72
|
-
public async processNewFiles() {
|
|
73
|
-
const dictionaries =
|
|
74
|
-
(await transpileBundledCode([...this.addedFiles])) ?? [];
|
|
75
|
-
|
|
76
|
-
console.info(
|
|
77
|
-
`New dictionaries: \n ${dictionaries.map(getRelativePath).join('\n')}`
|
|
78
|
-
);
|
|
79
|
-
|
|
80
|
-
console.info('Building TypeScript types...');
|
|
81
|
-
createTypes(dictionaries);
|
|
82
|
-
|
|
83
|
-
console.info('Building type index...');
|
|
84
|
-
createModuleAugmentation();
|
|
85
|
-
|
|
86
|
-
console.info('Building main...');
|
|
87
|
-
createDictionaryList();
|
|
88
|
-
|
|
89
|
-
this.managedFiles = new Set([...this.managedFiles, ...this.addedFiles]);
|
|
90
|
-
this.addedFiles.clear();
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
public async detectFileAddedOrRemoved() {
|
|
94
|
-
const filesFound: string[] = [];
|
|
95
|
-
|
|
96
|
-
for (const pattern of watchedFilesPatternWithPath) {
|
|
97
|
-
sync(pattern).map((file) => filesFound.push(file));
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
// Detect new files by comparing with files emitted in previous compilation
|
|
101
|
-
const newFiles = new Set(
|
|
102
|
-
filesFound.filter((x) => !this.managedFiles.has(x))
|
|
103
|
-
);
|
|
104
|
-
|
|
105
|
-
const removedFiles = new Set(
|
|
106
|
-
[...this.managedFiles].filter((x) => !filesFound.includes(x))
|
|
107
|
-
);
|
|
108
|
-
|
|
109
|
-
if (
|
|
110
|
-
// Check if there is new files
|
|
111
|
-
newFiles.size > 0
|
|
112
|
-
) {
|
|
113
|
-
console.info('New files:', [...newFiles]);
|
|
114
|
-
|
|
115
|
-
this.addedFiles = newFiles;
|
|
116
|
-
|
|
117
|
-
await this.processNewFiles();
|
|
118
|
-
}
|
|
119
|
-
|
|
120
|
-
if (
|
|
121
|
-
// Check if there is removed files
|
|
122
|
-
removedFiles.size > 0
|
|
123
|
-
) {
|
|
124
|
-
console.info('Removed files:', [...removedFiles]);
|
|
125
|
-
|
|
126
|
-
this.managedFiles = new Set(
|
|
127
|
-
[...this.managedFiles].filter((x) => !removedFiles.has(x))
|
|
128
|
-
);
|
|
129
|
-
}
|
|
130
|
-
|
|
131
|
-
// After the compilation, transpile the changed files if any
|
|
132
|
-
if (this.updatedFiles.size > 0) {
|
|
133
|
-
await this.processFilesChanges();
|
|
134
|
-
}
|
|
135
|
-
}
|
|
136
|
-
|
|
137
|
-
apply(compiler: Compiler): void {
|
|
138
|
-
compiler.hooks.entryOption.tap('EntryOptionPlugin', (context, entry) => {
|
|
139
|
-
if (typeof entry === 'function') {
|
|
140
|
-
// DynamicEntryPlugin is used to add entries at runtime when files are created, updated or deleted
|
|
141
|
-
new DynamicEntryPlugin(context, entry).apply(compiler);
|
|
142
|
-
}
|
|
143
|
-
|
|
144
|
-
return true;
|
|
145
|
-
});
|
|
146
|
-
|
|
147
|
-
compiler.hooks.afterEmit.tapAsync(
|
|
148
|
-
'IntLayerPlugin - Process dictionaries',
|
|
149
|
-
async (compilation, callback) => {
|
|
150
|
-
// Get a set of files that will be emitted in this compilation
|
|
151
|
-
const currentEmitFiles = new Set(Object.keys(compilation.assets));
|
|
152
|
-
|
|
153
|
-
if (
|
|
154
|
-
// Check if this first load
|
|
155
|
-
!this.managedFiles.size
|
|
156
|
-
) {
|
|
157
|
-
// Update previousEmitFiles for the next compilation
|
|
158
|
-
this.managedFiles = currentEmitFiles;
|
|
159
|
-
|
|
160
|
-
await this.initDictionaries();
|
|
161
|
-
}
|
|
162
|
-
|
|
163
|
-
await this.detectFileAddedOrRemoved();
|
|
164
|
-
|
|
165
|
-
callback();
|
|
166
|
-
}
|
|
167
|
-
);
|
|
168
|
-
|
|
169
|
-
// Detect modified files on watch mode
|
|
170
|
-
compiler.hooks.watchRun.tap(
|
|
171
|
-
'IntLayerPlugin - Change detection',
|
|
172
|
-
(compilation) => {
|
|
173
|
-
if (compilation.modifiedFiles) {
|
|
174
|
-
const updatedFiles = Array.from(compilation.modifiedFiles);
|
|
175
|
-
|
|
176
|
-
const outputFileNames = updatedFiles.map(
|
|
177
|
-
getBundledFilePathFromIntlayerModule
|
|
178
|
-
);
|
|
179
|
-
|
|
180
|
-
this.updatedFiles = new Set(outputFileNames);
|
|
181
|
-
}
|
|
182
|
-
}
|
|
183
|
-
);
|
|
7
|
+
apply(): void {
|
|
8
|
+
watch({ persistent });
|
|
184
9
|
}
|
|
185
10
|
}
|