@shuvi/toolpack 0.0.1-rc.9 → 1.0.0-rc.10
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/lib/babel/plugins/auto-css-modules.js +1 -1
- package/lib/babel/plugins/{loadable-plugin.d.ts → dynamic-plugin.d.ts} +1 -1
- package/lib/babel/plugins/{loadable-plugin.js → dynamic-plugin.js} +9 -9
- package/lib/babel/plugins/optimize-hook-destructuring.d.ts +1 -1
- package/lib/babel/plugins/optimize-hook-destructuring.js +4 -4
- package/lib/babel/preset.js +25 -5
- package/lib/constants.d.ts +1 -0
- package/lib/constants.js +5 -1
- package/lib/utils/bundle-require.d.ts +33 -0
- package/lib/utils/bundle-require.js +143 -0
- package/lib/utils/forkTsCheckerWebpackPlugin.js +2 -1
- package/lib/utils/formatWebpackMessages.d.ts +18 -4
- package/lib/utils/formatWebpackMessages.js +17 -14
- package/lib/webpack/config/base.d.ts +17 -4
- package/lib/webpack/config/base.js +144 -99
- package/lib/webpack/config/browser.d.ts +3 -4
- package/lib/webpack/config/browser.js +132 -56
- package/lib/webpack/config/index.js +18 -7
- package/lib/webpack/config/node.d.ts +3 -4
- package/lib/webpack/config/node.js +21 -28
- package/lib/webpack/config/parts/external.d.ts +3 -2
- package/lib/webpack/config/parts/external.js +16 -10
- package/lib/webpack/config/parts/helpers.d.ts +3 -1
- package/lib/webpack/config/parts/helpers.js +14 -1
- package/lib/webpack/config/parts/resolve.js +1 -0
- package/lib/webpack/config/parts/style.d.ts +5 -2
- package/lib/webpack/config/parts/style.js +125 -60
- package/lib/webpack/dynamic-dll/bundler/index.d.ts +22 -0
- package/lib/webpack/dynamic-dll/bundler/index.js +211 -0
- package/lib/webpack/dynamic-dll/bundler/webpack-config.d.ts +16 -0
- package/lib/webpack/dynamic-dll/bundler/webpack-config.js +116 -0
- package/lib/webpack/dynamic-dll/constants.d.ts +6 -0
- package/lib/webpack/dynamic-dll/constants.js +9 -0
- package/lib/webpack/dynamic-dll/dep/getCJSExports.d.ts +3 -0
- package/lib/webpack/dynamic-dll/dep/getCJSExports.js +58 -0
- package/lib/webpack/dynamic-dll/dep/getExposeFromContent.d.ts +1 -0
- package/lib/webpack/dynamic-dll/dep/getExposeFromContent.js +80 -0
- package/lib/webpack/dynamic-dll/dep/getModuleExports.d.ts +7 -0
- package/lib/webpack/dynamic-dll/dep/getModuleExports.js +46 -0
- package/lib/webpack/dynamic-dll/dep/index.d.ts +13 -0
- package/lib/webpack/dynamic-dll/dep/index.js +43 -0
- package/lib/webpack/dynamic-dll/helper/check-not-in-node-modules.d.ts +1 -0
- package/lib/webpack/dynamic-dll/helper/check-not-in-node-modules.js +15 -0
- package/lib/webpack/dynamic-dll/index.d.ts +35 -0
- package/lib/webpack/dynamic-dll/index.js +198 -0
- package/lib/webpack/dynamic-dll/metadata.d.ts +13 -0
- package/lib/webpack/dynamic-dll/metadata.js +62 -0
- package/lib/webpack/dynamic-dll/moduleCollector.d.ts +28 -0
- package/lib/webpack/dynamic-dll/moduleCollector.js +64 -0
- package/lib/webpack/dynamic-dll/plugin/dynamic-dll-plugin.d.ts +24 -0
- package/lib/webpack/dynamic-dll/plugin/dynamic-dll-plugin.js +70 -0
- package/lib/webpack/dynamic-dll/utils.d.ts +6 -0
- package/lib/webpack/dynamic-dll/utils.js +29 -0
- package/lib/webpack/index.d.ts +15 -0
- package/lib/webpack/index.js +110 -0
- package/lib/webpack/loaders/parcel-css-loader/CssSyntaxError.d.ts +11 -0
- package/lib/webpack/loaders/parcel-css-loader/CssSyntaxError.js +40 -0
- package/lib/webpack/loaders/parcel-css-loader/index.d.ts +4 -0
- package/lib/webpack/loaders/parcel-css-loader/index.js +369 -0
- package/lib/webpack/loaders/parcel-css-loader/runtime/api.d.ts +2 -0
- package/lib/webpack/loaders/parcel-css-loader/runtime/api.js +85 -0
- package/lib/webpack/loaders/parcel-css-loader/runtime/getUrl.d.ts +2 -0
- package/lib/webpack/loaders/parcel-css-loader/runtime/getUrl.js +23 -0
- package/lib/webpack/loaders/parcel-css-loader/runtime/noSourceMaps.d.ts +2 -0
- package/lib/webpack/loaders/parcel-css-loader/runtime/noSourceMaps.js +2 -0
- package/lib/webpack/loaders/parcel-css-loader/runtime/sourceMaps.d.ts +2 -0
- package/lib/webpack/loaders/parcel-css-loader/runtime/sourceMaps.js +16 -0
- package/lib/webpack/loaders/parcel-css-loader/utils.d.ts +28 -0
- package/lib/webpack/loaders/parcel-css-loader/utils.js +869 -0
- package/lib/webpack/loaders/route-component-loader.js +25 -5
- package/lib/webpack/loaders/shuvi-swc-loader/getLoaderSWCOptions.d.ts +94 -0
- package/lib/webpack/loaders/shuvi-swc-loader/getLoaderSWCOptions.js +162 -0
- package/lib/webpack/loaders/shuvi-swc-loader/index.d.ts +2 -0
- package/lib/webpack/loaders/shuvi-swc-loader/index.js +119 -0
- package/lib/webpack/plugins/build-manifest-plugin.js +44 -23
- package/lib/webpack/plugins/dynamic-public-path-plugin.d.ts +9 -0
- package/lib/webpack/plugins/dynamic-public-path-plugin.js +50 -0
- package/lib/webpack/plugins/fix-watching-plugin.d.ts +4 -0
- package/lib/webpack/plugins/fix-watching-plugin.js +23 -0
- package/lib/webpack/plugins/jsconfig-paths-plugin.d.ts +44 -0
- package/lib/webpack/plugins/jsconfig-paths-plugin.js +228 -0
- package/lib/webpack/plugins/module-replace-plugin/index.js +5 -1
- package/lib/webpack/plugins/module-replace-plugin/plugin.d.ts +7 -6
- package/lib/webpack/plugins/module-replace-plugin/plugin.js +56 -33
- package/lib/webpack/plugins/module-replace-plugin/stub-loader.js +47 -7
- package/lib/webpack/plugins/require-cache-hot-reloader-plugin.js +9 -8
- package/lib/webpack/plugins/support-ts-extension-resolver-plugin.d.ts +4 -0
- package/lib/webpack/plugins/support-ts-extension-resolver-plugin.js +23 -0
- package/lib/webpack/types.d.ts +40 -0
- package/lib/webpack/types.js +2 -0
- package/package.json +46 -40
- package/lib/utils/emptyComponent.d.ts +0 -1
- package/lib/utils/emptyComponent.js +0 -7
- package/lib/utils/errorOverlayMiddleware.d.ts +0 -1
- package/lib/utils/errorOverlayMiddleware.js +0 -21
- package/lib/utils/hotDevClient/eventsource.d.ts +0 -1
- package/lib/utils/hotDevClient/eventsource.js +0 -63
- package/lib/utils/hotDevClient/index.d.ts +0 -4
- package/lib/utils/hotDevClient/index.js +0 -289
- package/lib/utils/verifyTypeScriptSetup.d.ts +0 -5
- package/lib/utils/verifyTypeScriptSetup.js +0 -229
- package/lib/webpack/loaders/export-global-loader.d.ts +0 -7
- package/lib/webpack/loaders/export-global-loader.js +0 -26
|
@@ -0,0 +1,198 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
|
+
};
|
|
14
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
+
exports.DynamicDll = void 0;
|
|
16
|
+
const fs_extra_1 = require("fs-extra");
|
|
17
|
+
const path_1 = require("path");
|
|
18
|
+
const mrmime_1 = require("mrmime");
|
|
19
|
+
const webpack_virtual_modules_1 = __importDefault(require("webpack-virtual-modules"));
|
|
20
|
+
const invariant_1 = __importDefault(require("@shuvi/utils/lib/invariant"));
|
|
21
|
+
const constants_1 = require("./constants");
|
|
22
|
+
const bundler_1 = require("./bundler");
|
|
23
|
+
const dynamic_dll_plugin_1 = require("./plugin/dynamic-dll-plugin");
|
|
24
|
+
const metadata_1 = require("./metadata");
|
|
25
|
+
const utils_1 = require("./utils");
|
|
26
|
+
const check_not_in_node_modules_1 = require("./helper/check-not-in-node-modules");
|
|
27
|
+
function makeAsyncEntry(entry) {
|
|
28
|
+
const asyncEntry = {};
|
|
29
|
+
const virtualModules = {};
|
|
30
|
+
const entryObject = ((0, utils_1.isString)(entry) || (0, utils_1.isArray)(entry)
|
|
31
|
+
? { main: [].concat(entry) }
|
|
32
|
+
: entry);
|
|
33
|
+
for (const key of Object.keys(entryObject)) {
|
|
34
|
+
const virtualPath = `./dynamic-dll-virtual-entry/${key}.js`;
|
|
35
|
+
const virtualContent = [];
|
|
36
|
+
const entryFiles = (0, utils_1.isArray)(entryObject[key])
|
|
37
|
+
? entryObject[key]
|
|
38
|
+
: [entryObject[key]];
|
|
39
|
+
for (let entry of entryFiles) {
|
|
40
|
+
(0, invariant_1.default)((0, utils_1.isString)(entry), 'wepback entry must be a string');
|
|
41
|
+
virtualContent.push(`import('${entry}');`);
|
|
42
|
+
}
|
|
43
|
+
virtualModules[virtualPath] = virtualContent.join('\n');
|
|
44
|
+
asyncEntry[key] = virtualPath;
|
|
45
|
+
}
|
|
46
|
+
return {
|
|
47
|
+
asyncEntry,
|
|
48
|
+
virtualModules
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
class DynamicDll {
|
|
52
|
+
constructor(opts) {
|
|
53
|
+
this._hasBuilt = false;
|
|
54
|
+
this.handleSnapshot = (snapshot) => __awaiter(this, void 0, void 0, function* () {
|
|
55
|
+
if (this._hasBuilt) {
|
|
56
|
+
(0, metadata_1.writeUpdate)(this._cacheDir, snapshot);
|
|
57
|
+
return;
|
|
58
|
+
}
|
|
59
|
+
const originModules = (0, metadata_1.getMetadata)(this._cacheDir).modules;
|
|
60
|
+
const diffNames = this.getRemovedModules(snapshot, originModules);
|
|
61
|
+
const requiredSnapshot = Object.assign(Object.assign({}, originModules), snapshot);
|
|
62
|
+
diffNames.forEach(lib => {
|
|
63
|
+
delete requiredSnapshot[lib];
|
|
64
|
+
});
|
|
65
|
+
yield this._buildDLL(requiredSnapshot);
|
|
66
|
+
this._dllPlugin.disableDllReference();
|
|
67
|
+
this._hasBuilt = true;
|
|
68
|
+
});
|
|
69
|
+
this.middleware = (req, res, next) => __awaiter(this, void 0, void 0, function* () {
|
|
70
|
+
const url = req.url || '';
|
|
71
|
+
const shouldServe = url.startsWith(constants_1.DEFAULT_PUBLIC_PATH);
|
|
72
|
+
if (!shouldServe) {
|
|
73
|
+
return next();
|
|
74
|
+
}
|
|
75
|
+
this._bundler.onBuildComplete(() => {
|
|
76
|
+
const relativePath = url.replace(new RegExp(`^${constants_1.DEFAULT_PUBLIC_PATH}`), '/');
|
|
77
|
+
const filePath = (0, path_1.join)((0, utils_1.getDllDir)(this._cacheDir), relativePath);
|
|
78
|
+
const { mtime } = (0, fs_extra_1.statSync)(filePath);
|
|
79
|
+
// Get the last modification time of the file and convert the time into a world time string
|
|
80
|
+
let lastModified = mtime.toUTCString();
|
|
81
|
+
const ifModifiedSince = req.headers['if-modified-since'];
|
|
82
|
+
// Tell the browser what time to use the browser cache without asking the server directly, but it seems that it is not effective, and needs to learn why.
|
|
83
|
+
res.setHeader('cache-control', 'no-cache');
|
|
84
|
+
if (ifModifiedSince && lastModified <= ifModifiedSince) {
|
|
85
|
+
// If the request header contains the request ifModifiedSince and the file is not modified, it returns 304
|
|
86
|
+
res.writeHead(304, 'Not Modified');
|
|
87
|
+
res.end();
|
|
88
|
+
return;
|
|
89
|
+
}
|
|
90
|
+
// Return the header Last-Modified for the last modification time of the current request file
|
|
91
|
+
res.setHeader('Last-Modified', lastModified);
|
|
92
|
+
// Return file
|
|
93
|
+
res.setHeader('content-type', (0, mrmime_1.lookup)((0, path_1.extname)(url)) || 'text/plain');
|
|
94
|
+
const content = (0, fs_extra_1.readFileSync)(filePath);
|
|
95
|
+
res.statusCode = 200;
|
|
96
|
+
res.end(content);
|
|
97
|
+
});
|
|
98
|
+
});
|
|
99
|
+
this.modifyWebpackChain = (chain) => {
|
|
100
|
+
const webpack = this._resolveWebpackModule('webpack');
|
|
101
|
+
const entries = chain.entryPoints.entries();
|
|
102
|
+
const entry = Object.keys(entries).reduce((acc, name) => {
|
|
103
|
+
acc[name] = entries[name].values();
|
|
104
|
+
return acc;
|
|
105
|
+
}, {});
|
|
106
|
+
const { asyncEntry, virtualModules } = makeAsyncEntry(entry);
|
|
107
|
+
chain.entryPoints.clear();
|
|
108
|
+
chain.merge({
|
|
109
|
+
entry: asyncEntry
|
|
110
|
+
});
|
|
111
|
+
chain
|
|
112
|
+
.plugin('dynamic-virtual-modules')
|
|
113
|
+
.use(webpack_virtual_modules_1.default, [virtualModules]);
|
|
114
|
+
chain
|
|
115
|
+
.plugin('dynamic-dll-mf')
|
|
116
|
+
.use(webpack.container.ModuleFederationPlugin, [this._getMFconfig()]);
|
|
117
|
+
chain.plugin('dynamic-dll-plugin').use(this._dllPlugin);
|
|
118
|
+
return chain;
|
|
119
|
+
};
|
|
120
|
+
this.modifyWebpack = (config) => {
|
|
121
|
+
const { asyncEntry, virtualModules } = makeAsyncEntry(config.entry);
|
|
122
|
+
config.entry = asyncEntry;
|
|
123
|
+
const webpack = this._resolveWebpackModule('webpack');
|
|
124
|
+
if (!config.plugins) {
|
|
125
|
+
config.plugins = [];
|
|
126
|
+
}
|
|
127
|
+
config.plugins.push(new webpack_virtual_modules_1.default(virtualModules), new webpack.container.ModuleFederationPlugin(this._getMFconfig()), this._dllPlugin);
|
|
128
|
+
return config;
|
|
129
|
+
};
|
|
130
|
+
this._opts = opts;
|
|
131
|
+
this._cacheDir = opts.cacheDir;
|
|
132
|
+
this._rootDir = opts.rootDir;
|
|
133
|
+
this._resolveWebpackModule = opts.resolveWebpackModule || require;
|
|
134
|
+
this._bundler = new bundler_1.Bundler();
|
|
135
|
+
this._dllPlugin = new dynamic_dll_plugin_1.DynamicDLLPlugin({
|
|
136
|
+
include: opts.include,
|
|
137
|
+
exclude: opts.exclude,
|
|
138
|
+
dllName: constants_1.NAME,
|
|
139
|
+
resolveWebpackModule: this._resolveWebpackModule,
|
|
140
|
+
onSnapshot: this.handleSnapshot
|
|
141
|
+
});
|
|
142
|
+
}
|
|
143
|
+
getRemovedModules(snapshot, originModules) {
|
|
144
|
+
return Object.keys(originModules).filter(key => {
|
|
145
|
+
if (snapshot[key]) {
|
|
146
|
+
return false;
|
|
147
|
+
}
|
|
148
|
+
return (0, check_not_in_node_modules_1.checkNotInNodeModules)(key, this._rootDir);
|
|
149
|
+
});
|
|
150
|
+
}
|
|
151
|
+
_buildDLL(snapshot) {
|
|
152
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
153
|
+
yield this._bundler.build(snapshot, {
|
|
154
|
+
outputDir: this._cacheDir,
|
|
155
|
+
shared: this._opts.shared,
|
|
156
|
+
externals: this._opts.externals,
|
|
157
|
+
esmFullSpecific: this._opts.esmFullSpecific,
|
|
158
|
+
force: process.env.DLL_FORCE_BUILD === 'true'
|
|
159
|
+
});
|
|
160
|
+
});
|
|
161
|
+
}
|
|
162
|
+
_getMFconfig() {
|
|
163
|
+
return {
|
|
164
|
+
name: '__',
|
|
165
|
+
remotes: {
|
|
166
|
+
// [NAME]: `${NAME}@${DEFAULT_PUBLIC_PATH}${DLL_FILENAME}`,
|
|
167
|
+
// https://webpack.js.org/concepts/module-federation/#promise-based-dynamic-remotes
|
|
168
|
+
[constants_1.NAME]: `
|
|
169
|
+
promise new Promise(resolve => {
|
|
170
|
+
const remoteUrl = '${constants_1.DEFAULT_PUBLIC_PATH}${constants_1.DLL_FILENAME}';
|
|
171
|
+
const script = document.createElement('script');
|
|
172
|
+
script.src = remoteUrl;
|
|
173
|
+
script.onload = () => {
|
|
174
|
+
// the injected script has loaded and is available on window
|
|
175
|
+
// we can now resolve this Promise
|
|
176
|
+
const proxy = {
|
|
177
|
+
get: (request) => {
|
|
178
|
+
const promise = window['${constants_1.NAME}'].get(request);
|
|
179
|
+
return promise;
|
|
180
|
+
},
|
|
181
|
+
init: (arg) => {
|
|
182
|
+
try {
|
|
183
|
+
return window['${constants_1.NAME}'].init(arg);
|
|
184
|
+
} catch(e) {
|
|
185
|
+
console.log('remote container already initialized');
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
resolve(proxy);
|
|
190
|
+
}
|
|
191
|
+
// inject this script with the src set to the versioned remoteEntry.js
|
|
192
|
+
document.head.appendChild(script);
|
|
193
|
+
})`.trim()
|
|
194
|
+
}
|
|
195
|
+
};
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
exports.DynamicDll = DynamicDll;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { ModuleInfo } from './moduleCollector';
|
|
2
|
+
export interface Metadata {
|
|
3
|
+
hash: string;
|
|
4
|
+
buildHash: string;
|
|
5
|
+
modules: Record<string, ModuleInfo>;
|
|
6
|
+
}
|
|
7
|
+
export interface Update {
|
|
8
|
+
discovered: Record<string, ModuleInfo>;
|
|
9
|
+
}
|
|
10
|
+
export declare function getMetadata(root: string): Metadata;
|
|
11
|
+
export declare function writeMetadata(root: string, content: Metadata): void;
|
|
12
|
+
export declare function getUpdate(root: string): Update;
|
|
13
|
+
export declare function writeUpdate(root: string, updateModules: Record<string, ModuleInfo>): void;
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.writeUpdate = exports.getUpdate = exports.writeMetadata = exports.getMetadata = void 0;
|
|
4
|
+
const path_1 = require("path");
|
|
5
|
+
const fs_extra_1 = require("fs-extra");
|
|
6
|
+
const constants_1 = require("./constants");
|
|
7
|
+
const utils_1 = require("./utils");
|
|
8
|
+
let lastMetadata = null;
|
|
9
|
+
function getNewModules(pre, next) {
|
|
10
|
+
const result = {};
|
|
11
|
+
for (const key of Object.keys(next)) {
|
|
12
|
+
let preItem = pre[key];
|
|
13
|
+
let item = next[key];
|
|
14
|
+
if (!preItem) {
|
|
15
|
+
result[key] = item;
|
|
16
|
+
}
|
|
17
|
+
else if (preItem.version != item.version) {
|
|
18
|
+
result[key] = item;
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
return result;
|
|
22
|
+
}
|
|
23
|
+
function getMetadata(root) {
|
|
24
|
+
const file = (0, path_1.join)((0, utils_1.getDllDir)(root), constants_1.METADATA_FILENAME);
|
|
25
|
+
if (!(0, fs_extra_1.existsSync)(file)) {
|
|
26
|
+
return {
|
|
27
|
+
hash: '',
|
|
28
|
+
buildHash: '',
|
|
29
|
+
modules: {}
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
return (0, fs_extra_1.readJSONSync)(file);
|
|
33
|
+
}
|
|
34
|
+
exports.getMetadata = getMetadata;
|
|
35
|
+
function writeMetadata(root, content) {
|
|
36
|
+
(0, fs_extra_1.writeJSONSync)((0, path_1.join)(root, constants_1.METADATA_FILENAME), content, {
|
|
37
|
+
spaces: 2
|
|
38
|
+
});
|
|
39
|
+
lastMetadata = content;
|
|
40
|
+
}
|
|
41
|
+
exports.writeMetadata = writeMetadata;
|
|
42
|
+
function getUpdate(root) {
|
|
43
|
+
const file = (0, path_1.join)((0, utils_1.getDllDir)(root), constants_1.UPDATE_FILENAME);
|
|
44
|
+
if (!(0, fs_extra_1.existsSync)(file)) {
|
|
45
|
+
return {
|
|
46
|
+
discovered: {}
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
return (0, fs_extra_1.readJSONSync)(file);
|
|
50
|
+
}
|
|
51
|
+
exports.getUpdate = getUpdate;
|
|
52
|
+
function writeUpdate(root, updateModules) {
|
|
53
|
+
if (!lastMetadata) {
|
|
54
|
+
return;
|
|
55
|
+
}
|
|
56
|
+
(0, fs_extra_1.writeJSONSync)((0, path_1.join)((0, utils_1.getDllDir)(root), constants_1.UPDATE_FILENAME), {
|
|
57
|
+
discovered: getNewModules(lastMetadata.modules, updateModules)
|
|
58
|
+
}, {
|
|
59
|
+
spaces: 2
|
|
60
|
+
});
|
|
61
|
+
}
|
|
62
|
+
exports.writeUpdate = writeUpdate;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
export interface ModuleInfo {
|
|
2
|
+
libraryPath: string;
|
|
3
|
+
version: string;
|
|
4
|
+
}
|
|
5
|
+
export interface ModuleCollectorOptions {
|
|
6
|
+
include?: RegExp[];
|
|
7
|
+
exclude?: RegExp[];
|
|
8
|
+
}
|
|
9
|
+
export interface ModuleSnapshot {
|
|
10
|
+
[key: string]: ModuleInfo;
|
|
11
|
+
}
|
|
12
|
+
declare class ModuleCollector {
|
|
13
|
+
private _include;
|
|
14
|
+
private _exclude;
|
|
15
|
+
private _modules;
|
|
16
|
+
private _changed;
|
|
17
|
+
constructor(options: ModuleCollectorOptions);
|
|
18
|
+
shouldCollect({ request, context, resource }: {
|
|
19
|
+
request: string;
|
|
20
|
+
context: string;
|
|
21
|
+
resource: string;
|
|
22
|
+
}): boolean;
|
|
23
|
+
hasChanged(): boolean;
|
|
24
|
+
add(id: string, { libraryPath, version }: ModuleInfo): void;
|
|
25
|
+
snapshot(): ModuleSnapshot;
|
|
26
|
+
}
|
|
27
|
+
export type { ModuleCollector };
|
|
28
|
+
export declare function getModuleCollector(options: ModuleCollectorOptions): ModuleCollector;
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getModuleCollector = void 0;
|
|
4
|
+
const NODE_MODULES = /node_modules/;
|
|
5
|
+
class ModuleCollector {
|
|
6
|
+
constructor(options) {
|
|
7
|
+
this._modules = {};
|
|
8
|
+
this._include = options.include || [];
|
|
9
|
+
this._exclude = options.exclude || [];
|
|
10
|
+
this._changed = false;
|
|
11
|
+
}
|
|
12
|
+
shouldCollect({ request, context, resource }) {
|
|
13
|
+
if (request.startsWith('.')) {
|
|
14
|
+
return false;
|
|
15
|
+
}
|
|
16
|
+
// only inlucde modules that user has referenced in his src/
|
|
17
|
+
if (NODE_MODULES.test(context)) {
|
|
18
|
+
return false;
|
|
19
|
+
}
|
|
20
|
+
if (this._exclude.some(p => p.test(request))) {
|
|
21
|
+
return false;
|
|
22
|
+
}
|
|
23
|
+
if (this._include.some(p => p.test(request))) {
|
|
24
|
+
return true;
|
|
25
|
+
}
|
|
26
|
+
return NODE_MODULES.test(resource);
|
|
27
|
+
}
|
|
28
|
+
hasChanged() {
|
|
29
|
+
return this._changed;
|
|
30
|
+
}
|
|
31
|
+
add(id, { libraryPath, version }) {
|
|
32
|
+
const modules = this._modules;
|
|
33
|
+
const mod = modules[id];
|
|
34
|
+
if (!mod) {
|
|
35
|
+
modules[id] = {
|
|
36
|
+
libraryPath,
|
|
37
|
+
version
|
|
38
|
+
};
|
|
39
|
+
this._changed = true;
|
|
40
|
+
}
|
|
41
|
+
else {
|
|
42
|
+
const { version: oldVersion } = mod;
|
|
43
|
+
if (oldVersion !== version) {
|
|
44
|
+
modules[id] = {
|
|
45
|
+
libraryPath,
|
|
46
|
+
version
|
|
47
|
+
};
|
|
48
|
+
this._changed = true;
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
snapshot() {
|
|
53
|
+
const snapshot = Object.assign({}, this._modules);
|
|
54
|
+
this._changed = false;
|
|
55
|
+
return snapshot;
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
function getModuleCollector(options) {
|
|
59
|
+
return new ModuleCollector({
|
|
60
|
+
include: options.include,
|
|
61
|
+
exclude: options.exclude
|
|
62
|
+
});
|
|
63
|
+
}
|
|
64
|
+
exports.getModuleCollector = getModuleCollector;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
/// <reference types="webpack-env" />
|
|
3
|
+
import type { Compiler } from 'webpack';
|
|
4
|
+
import { ModuleCollectorOptions, ModuleSnapshot } from '../moduleCollector';
|
|
5
|
+
export declare type SnapshotListener = (snapshot: ModuleSnapshot) => void;
|
|
6
|
+
export interface DynamicDLLPluginOptions {
|
|
7
|
+
resolveWebpackModule: (s: string) => ReturnType<typeof require>;
|
|
8
|
+
dllName: string;
|
|
9
|
+
onSnapshot: SnapshotListener;
|
|
10
|
+
shareScope?: string;
|
|
11
|
+
}
|
|
12
|
+
export declare class DynamicDLLPlugin {
|
|
13
|
+
private _collector;
|
|
14
|
+
private _resolveWebpackModule;
|
|
15
|
+
private _dllName;
|
|
16
|
+
private _shareScope?;
|
|
17
|
+
private _timer;
|
|
18
|
+
private _matchCache;
|
|
19
|
+
private _onSnapshot;
|
|
20
|
+
private _disabled;
|
|
21
|
+
constructor(opts: DynamicDLLPluginOptions & ModuleCollectorOptions);
|
|
22
|
+
disableDllReference(): void;
|
|
23
|
+
apply(compiler: Compiler): void;
|
|
24
|
+
}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DynamicDLLPlugin = void 0;
|
|
4
|
+
const moduleCollector_1 = require("../moduleCollector");
|
|
5
|
+
const PLUGIN_NAME = 'DLLBuildDeps';
|
|
6
|
+
class DynamicDLLPlugin {
|
|
7
|
+
constructor(opts) {
|
|
8
|
+
this._resolveWebpackModule = opts.resolveWebpackModule;
|
|
9
|
+
this._dllName = opts.dllName;
|
|
10
|
+
this._shareScope = opts.shareScope;
|
|
11
|
+
this._onSnapshot = opts.onSnapshot;
|
|
12
|
+
this._collector = (0, moduleCollector_1.getModuleCollector)({
|
|
13
|
+
include: opts.include,
|
|
14
|
+
exclude: opts.exclude
|
|
15
|
+
});
|
|
16
|
+
this._matchCache = new Map();
|
|
17
|
+
this._timer = null;
|
|
18
|
+
this._disabled = false;
|
|
19
|
+
}
|
|
20
|
+
disableDllReference() {
|
|
21
|
+
this._disabled = true;
|
|
22
|
+
}
|
|
23
|
+
apply(compiler) {
|
|
24
|
+
compiler.hooks.normalModuleFactory.tap(PLUGIN_NAME, nmf => {
|
|
25
|
+
nmf.hooks.beforeResolve.tap(PLUGIN_NAME, resolveData => {
|
|
26
|
+
const { request } = resolveData;
|
|
27
|
+
const replaceValue = this._matchCache.get(request);
|
|
28
|
+
if (replaceValue) {
|
|
29
|
+
resolveData.request = replaceValue;
|
|
30
|
+
}
|
|
31
|
+
});
|
|
32
|
+
nmf.hooks.createModule.tap(PLUGIN_NAME, (_createData, resolveData) => {
|
|
33
|
+
const { createData = {}, request } = resolveData;
|
|
34
|
+
const { resource = '' } = createData;
|
|
35
|
+
if (!this._collector.shouldCollect({
|
|
36
|
+
request,
|
|
37
|
+
context: resolveData.context,
|
|
38
|
+
resource
|
|
39
|
+
})) {
|
|
40
|
+
return;
|
|
41
|
+
}
|
|
42
|
+
const { resourceResolveData: { descriptionFileData: { version = null } } = {} } = createData;
|
|
43
|
+
this._collector.add(request, {
|
|
44
|
+
libraryPath: resource,
|
|
45
|
+
version
|
|
46
|
+
});
|
|
47
|
+
if (this._disabled) {
|
|
48
|
+
return;
|
|
49
|
+
}
|
|
50
|
+
const name = this._dllName;
|
|
51
|
+
const replaceValue = `${name}/${request}`;
|
|
52
|
+
resolveData.request = replaceValue;
|
|
53
|
+
this._matchCache.set(request, replaceValue);
|
|
54
|
+
const RemoteModule = this._resolveWebpackModule(`webpack/lib/container/RemoteModule`);
|
|
55
|
+
return new RemoteModule(resolveData.request, [`webpack/container/reference/${name}`], `.${resolveData.request.slice(name.length)}`, this._shareScope || 'default');
|
|
56
|
+
});
|
|
57
|
+
});
|
|
58
|
+
compiler.hooks.done.tap(PLUGIN_NAME, (stats) => {
|
|
59
|
+
if (!stats.hasErrors()) {
|
|
60
|
+
if (this._timer) {
|
|
61
|
+
clearTimeout(this._timer);
|
|
62
|
+
}
|
|
63
|
+
this._timer = setTimeout(() => {
|
|
64
|
+
this._onSnapshot(this._collector.snapshot());
|
|
65
|
+
}, 500);
|
|
66
|
+
}
|
|
67
|
+
});
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
exports.DynamicDLLPlugin = DynamicDLLPlugin;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export declare const version: any;
|
|
2
|
+
export declare function isString(val: unknown): val is string;
|
|
3
|
+
export declare function isArray(val: unknown): val is any[];
|
|
4
|
+
export declare function getDepsDir(dir: string): string;
|
|
5
|
+
export declare function getDllDir(dir: string): string;
|
|
6
|
+
export declare function getDllPendingDir(dir: string): string;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.getDllPendingDir = exports.getDllDir = exports.getDepsDir = exports.isArray = exports.isString = exports.version = void 0;
|
|
7
|
+
const path_1 = __importDefault(require("path"));
|
|
8
|
+
const pkg = require(path_1.default.resolve(__dirname, '../../..', 'package.json'));
|
|
9
|
+
exports.version = pkg.version;
|
|
10
|
+
function isString(val) {
|
|
11
|
+
return typeof val === 'string';
|
|
12
|
+
}
|
|
13
|
+
exports.isString = isString;
|
|
14
|
+
function isArray(val) {
|
|
15
|
+
return Array.isArray(val);
|
|
16
|
+
}
|
|
17
|
+
exports.isArray = isArray;
|
|
18
|
+
function getDepsDir(dir) {
|
|
19
|
+
return path_1.default.join(dir, 'deps');
|
|
20
|
+
}
|
|
21
|
+
exports.getDepsDir = getDepsDir;
|
|
22
|
+
function getDllDir(dir) {
|
|
23
|
+
return path_1.default.join(dir, 'current');
|
|
24
|
+
}
|
|
25
|
+
exports.getDllDir = getDllDir;
|
|
26
|
+
function getDllPendingDir(dir) {
|
|
27
|
+
return path_1.default.join(dir, 'pending');
|
|
28
|
+
}
|
|
29
|
+
exports.getDllPendingDir = getDllPendingDir;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import webpack from 'webpack';
|
|
2
|
+
export { webpack as default };
|
|
3
|
+
export { WebpackChain } from './config';
|
|
4
|
+
export { DynamicDll } from './dynamic-dll';
|
|
5
|
+
/**
|
|
6
|
+
* re-export for shuvi plugin
|
|
7
|
+
*/
|
|
8
|
+
export { webpack, validate, validateSchema, version, cli, ModuleFilenameHelpers, RuntimeGlobals, UsageState, WebpackOptionsValidationError, ValidationError, cache, config, dependencies, ids, javascript, optimize, runtime, prefetch, web, webworker, node, electron, wasm, library, container, sharing, debug, util, sources, experiments, WebpackPluginFunction,
|
|
9
|
+
/** export */
|
|
10
|
+
AutomaticPrefetchPlugin, AsyncDependenciesBlock, BannerPlugin, Cache, Chunk, ChunkGraph, CleanPlugin, Compilation, Compiler, ConcatenationScope, ContextExclusionPlugin, ContextReplacementPlugin, DefinePlugin, DelegatedPlugin, Dependency, DllPlugin, DllReferencePlugin, DynamicEntryPlugin, EntryOptionPlugin, EntryPlugin, EnvironmentPlugin, EvalDevToolModulePlugin, EvalSourceMapDevToolPlugin, ExternalModule, ExternalsPlugin, Generator, HotUpdateChunk, HotModuleReplacementPlugin, IgnorePlugin, JavascriptModulesPlugin, LibManifestPlugin, LibraryTemplatePlugin, LoaderOptionsPlugin, LoaderTargetPlugin, Module, ModuleGraph, ModuleGraphConnection, NoEmitOnErrorsPlugin, NormalModule, NormalModuleReplacementPlugin, MultiCompiler, Parser, Plugin, PrefetchPlugin, ProgressPlugin, ProvidePlugin, RuntimeModule, EntryPlugin as SingleEntryPlugin, SourceMapDevToolPlugin, Stats, Template, WatchIgnorePlugin, WebpackError, WebpackOptionsApply, WebpackOptionsDefaulter, Entry, EntryNormalized, EntryObject, LibraryOptions, ModuleOptions, ResolveOptions, RuleSetCondition, RuleSetConditionAbsolute, RuleSetRule, RuleSetUse, RuleSetUseItem, Configuration, WebpackOptionsNormalized, WebpackPluginInstance, Asset, AssetInfo, MultiStats, ParserState, Watching, StatsAsset, StatsChunk, StatsChunkGroup, StatsChunkOrigin, StatsCompilation, StatsError, StatsLogging, StatsLoggingEntry, StatsModule, StatsModuleIssuer, StatsModuleReason, StatsModuleTraceDependency, StatsModuleTraceItem, StatsProfile } from 'webpack';
|
|
11
|
+
/**
|
|
12
|
+
* resolve webpack module for not shuvi plugin
|
|
13
|
+
*/
|
|
14
|
+
declare const webpackResolveContext: string;
|
|
15
|
+
export { webpackResolveContext };
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.DllReferencePlugin = exports.DllPlugin = exports.Dependency = exports.DelegatedPlugin = exports.DefinePlugin = exports.ContextReplacementPlugin = exports.ContextExclusionPlugin = exports.ConcatenationScope = exports.Compiler = exports.Compilation = exports.CleanPlugin = exports.ChunkGraph = exports.Chunk = exports.Cache = exports.BannerPlugin = exports.AsyncDependenciesBlock = exports.AutomaticPrefetchPlugin = exports.experiments = exports.sources = exports.util = exports.debug = exports.sharing = exports.container = exports.library = exports.wasm = exports.electron = exports.node = exports.webworker = exports.web = exports.prefetch = exports.runtime = exports.optimize = exports.javascript = exports.ids = exports.dependencies = exports.config = exports.cache = exports.ValidationError = exports.WebpackOptionsValidationError = exports.UsageState = exports.RuntimeGlobals = exports.ModuleFilenameHelpers = exports.cli = exports.version = exports.validateSchema = exports.validate = exports.webpack = exports.DynamicDll = exports.WebpackChain = exports.default = void 0;
|
|
7
|
+
exports.webpackResolveContext = exports.Watching = exports.MultiStats = exports.WebpackOptionsDefaulter = exports.WebpackOptionsApply = exports.WebpackError = exports.WatchIgnorePlugin = exports.Template = exports.Stats = exports.SourceMapDevToolPlugin = exports.SingleEntryPlugin = exports.RuntimeModule = exports.ProvidePlugin = exports.ProgressPlugin = exports.PrefetchPlugin = exports.Parser = exports.MultiCompiler = exports.NormalModuleReplacementPlugin = exports.NormalModule = exports.NoEmitOnErrorsPlugin = exports.ModuleGraphConnection = exports.ModuleGraph = exports.Module = exports.LoaderTargetPlugin = exports.LoaderOptionsPlugin = exports.LibraryTemplatePlugin = exports.LibManifestPlugin = exports.JavascriptModulesPlugin = exports.IgnorePlugin = exports.HotModuleReplacementPlugin = exports.HotUpdateChunk = exports.Generator = exports.ExternalsPlugin = exports.ExternalModule = exports.EvalSourceMapDevToolPlugin = exports.EvalDevToolModulePlugin = exports.EnvironmentPlugin = exports.EntryPlugin = exports.EntryOptionPlugin = exports.DynamicEntryPlugin = void 0;
|
|
8
|
+
const path_1 = require("path");
|
|
9
|
+
const webpack_1 = __importDefault(require("webpack"));
|
|
10
|
+
exports.default = webpack_1.default;
|
|
11
|
+
var config_1 = require("./config");
|
|
12
|
+
Object.defineProperty(exports, "WebpackChain", { enumerable: true, get: function () { return config_1.WebpackChain; } });
|
|
13
|
+
var dynamic_dll_1 = require("./dynamic-dll");
|
|
14
|
+
Object.defineProperty(exports, "DynamicDll", { enumerable: true, get: function () { return dynamic_dll_1.DynamicDll; } });
|
|
15
|
+
/**
|
|
16
|
+
* re-export for shuvi plugin
|
|
17
|
+
*/
|
|
18
|
+
var webpack_2 = require("webpack");
|
|
19
|
+
Object.defineProperty(exports, "webpack", { enumerable: true, get: function () { return webpack_2.webpack; } });
|
|
20
|
+
Object.defineProperty(exports, "validate", { enumerable: true, get: function () { return webpack_2.validate; } });
|
|
21
|
+
Object.defineProperty(exports, "validateSchema", { enumerable: true, get: function () { return webpack_2.validateSchema; } });
|
|
22
|
+
Object.defineProperty(exports, "version", { enumerable: true, get: function () { return webpack_2.version; } });
|
|
23
|
+
Object.defineProperty(exports, "cli", { enumerable: true, get: function () { return webpack_2.cli; } });
|
|
24
|
+
Object.defineProperty(exports, "ModuleFilenameHelpers", { enumerable: true, get: function () { return webpack_2.ModuleFilenameHelpers; } });
|
|
25
|
+
Object.defineProperty(exports, "RuntimeGlobals", { enumerable: true, get: function () { return webpack_2.RuntimeGlobals; } });
|
|
26
|
+
Object.defineProperty(exports, "UsageState", { enumerable: true, get: function () { return webpack_2.UsageState; } });
|
|
27
|
+
Object.defineProperty(exports, "WebpackOptionsValidationError", { enumerable: true, get: function () { return webpack_2.WebpackOptionsValidationError; } });
|
|
28
|
+
Object.defineProperty(exports, "ValidationError", { enumerable: true, get: function () { return webpack_2.ValidationError; } });
|
|
29
|
+
Object.defineProperty(exports, "cache", { enumerable: true, get: function () { return webpack_2.cache; } });
|
|
30
|
+
Object.defineProperty(exports, "config", { enumerable: true, get: function () { return webpack_2.config; } });
|
|
31
|
+
Object.defineProperty(exports, "dependencies", { enumerable: true, get: function () { return webpack_2.dependencies; } });
|
|
32
|
+
Object.defineProperty(exports, "ids", { enumerable: true, get: function () { return webpack_2.ids; } });
|
|
33
|
+
Object.defineProperty(exports, "javascript", { enumerable: true, get: function () { return webpack_2.javascript; } });
|
|
34
|
+
Object.defineProperty(exports, "optimize", { enumerable: true, get: function () { return webpack_2.optimize; } });
|
|
35
|
+
Object.defineProperty(exports, "runtime", { enumerable: true, get: function () { return webpack_2.runtime; } });
|
|
36
|
+
Object.defineProperty(exports, "prefetch", { enumerable: true, get: function () { return webpack_2.prefetch; } });
|
|
37
|
+
Object.defineProperty(exports, "web", { enumerable: true, get: function () { return webpack_2.web; } });
|
|
38
|
+
Object.defineProperty(exports, "webworker", { enumerable: true, get: function () { return webpack_2.webworker; } });
|
|
39
|
+
Object.defineProperty(exports, "node", { enumerable: true, get: function () { return webpack_2.node; } });
|
|
40
|
+
Object.defineProperty(exports, "electron", { enumerable: true, get: function () { return webpack_2.electron; } });
|
|
41
|
+
Object.defineProperty(exports, "wasm", { enumerable: true, get: function () { return webpack_2.wasm; } });
|
|
42
|
+
Object.defineProperty(exports, "library", { enumerable: true, get: function () { return webpack_2.library; } });
|
|
43
|
+
Object.defineProperty(exports, "container", { enumerable: true, get: function () { return webpack_2.container; } });
|
|
44
|
+
Object.defineProperty(exports, "sharing", { enumerable: true, get: function () { return webpack_2.sharing; } });
|
|
45
|
+
Object.defineProperty(exports, "debug", { enumerable: true, get: function () { return webpack_2.debug; } });
|
|
46
|
+
Object.defineProperty(exports, "util", { enumerable: true, get: function () { return webpack_2.util; } });
|
|
47
|
+
Object.defineProperty(exports, "sources", { enumerable: true, get: function () { return webpack_2.sources; } });
|
|
48
|
+
Object.defineProperty(exports, "experiments", { enumerable: true, get: function () { return webpack_2.experiments; } });
|
|
49
|
+
/** export */
|
|
50
|
+
Object.defineProperty(exports, "AutomaticPrefetchPlugin", { enumerable: true, get: function () { return webpack_2.AutomaticPrefetchPlugin; } });
|
|
51
|
+
Object.defineProperty(exports, "AsyncDependenciesBlock", { enumerable: true, get: function () { return webpack_2.AsyncDependenciesBlock; } });
|
|
52
|
+
Object.defineProperty(exports, "BannerPlugin", { enumerable: true, get: function () { return webpack_2.BannerPlugin; } });
|
|
53
|
+
Object.defineProperty(exports, "Cache", { enumerable: true, get: function () { return webpack_2.Cache; } });
|
|
54
|
+
Object.defineProperty(exports, "Chunk", { enumerable: true, get: function () { return webpack_2.Chunk; } });
|
|
55
|
+
Object.defineProperty(exports, "ChunkGraph", { enumerable: true, get: function () { return webpack_2.ChunkGraph; } });
|
|
56
|
+
Object.defineProperty(exports, "CleanPlugin", { enumerable: true, get: function () { return webpack_2.CleanPlugin; } });
|
|
57
|
+
Object.defineProperty(exports, "Compilation", { enumerable: true, get: function () { return webpack_2.Compilation; } });
|
|
58
|
+
Object.defineProperty(exports, "Compiler", { enumerable: true, get: function () { return webpack_2.Compiler; } });
|
|
59
|
+
Object.defineProperty(exports, "ConcatenationScope", { enumerable: true, get: function () { return webpack_2.ConcatenationScope; } });
|
|
60
|
+
Object.defineProperty(exports, "ContextExclusionPlugin", { enumerable: true, get: function () { return webpack_2.ContextExclusionPlugin; } });
|
|
61
|
+
Object.defineProperty(exports, "ContextReplacementPlugin", { enumerable: true, get: function () { return webpack_2.ContextReplacementPlugin; } });
|
|
62
|
+
Object.defineProperty(exports, "DefinePlugin", { enumerable: true, get: function () { return webpack_2.DefinePlugin; } });
|
|
63
|
+
Object.defineProperty(exports, "DelegatedPlugin", { enumerable: true, get: function () { return webpack_2.DelegatedPlugin; } });
|
|
64
|
+
Object.defineProperty(exports, "Dependency", { enumerable: true, get: function () { return webpack_2.Dependency; } });
|
|
65
|
+
Object.defineProperty(exports, "DllPlugin", { enumerable: true, get: function () { return webpack_2.DllPlugin; } });
|
|
66
|
+
Object.defineProperty(exports, "DllReferencePlugin", { enumerable: true, get: function () { return webpack_2.DllReferencePlugin; } });
|
|
67
|
+
Object.defineProperty(exports, "DynamicEntryPlugin", { enumerable: true, get: function () { return webpack_2.DynamicEntryPlugin; } });
|
|
68
|
+
Object.defineProperty(exports, "EntryOptionPlugin", { enumerable: true, get: function () { return webpack_2.EntryOptionPlugin; } });
|
|
69
|
+
Object.defineProperty(exports, "EntryPlugin", { enumerable: true, get: function () { return webpack_2.EntryPlugin; } });
|
|
70
|
+
Object.defineProperty(exports, "EnvironmentPlugin", { enumerable: true, get: function () { return webpack_2.EnvironmentPlugin; } });
|
|
71
|
+
Object.defineProperty(exports, "EvalDevToolModulePlugin", { enumerable: true, get: function () { return webpack_2.EvalDevToolModulePlugin; } });
|
|
72
|
+
Object.defineProperty(exports, "EvalSourceMapDevToolPlugin", { enumerable: true, get: function () { return webpack_2.EvalSourceMapDevToolPlugin; } });
|
|
73
|
+
Object.defineProperty(exports, "ExternalModule", { enumerable: true, get: function () { return webpack_2.ExternalModule; } });
|
|
74
|
+
Object.defineProperty(exports, "ExternalsPlugin", { enumerable: true, get: function () { return webpack_2.ExternalsPlugin; } });
|
|
75
|
+
Object.defineProperty(exports, "Generator", { enumerable: true, get: function () { return webpack_2.Generator; } });
|
|
76
|
+
Object.defineProperty(exports, "HotUpdateChunk", { enumerable: true, get: function () { return webpack_2.HotUpdateChunk; } });
|
|
77
|
+
Object.defineProperty(exports, "HotModuleReplacementPlugin", { enumerable: true, get: function () { return webpack_2.HotModuleReplacementPlugin; } });
|
|
78
|
+
Object.defineProperty(exports, "IgnorePlugin", { enumerable: true, get: function () { return webpack_2.IgnorePlugin; } });
|
|
79
|
+
Object.defineProperty(exports, "JavascriptModulesPlugin", { enumerable: true, get: function () { return webpack_2.JavascriptModulesPlugin; } });
|
|
80
|
+
Object.defineProperty(exports, "LibManifestPlugin", { enumerable: true, get: function () { return webpack_2.LibManifestPlugin; } });
|
|
81
|
+
Object.defineProperty(exports, "LibraryTemplatePlugin", { enumerable: true, get: function () { return webpack_2.LibraryTemplatePlugin; } });
|
|
82
|
+
Object.defineProperty(exports, "LoaderOptionsPlugin", { enumerable: true, get: function () { return webpack_2.LoaderOptionsPlugin; } });
|
|
83
|
+
Object.defineProperty(exports, "LoaderTargetPlugin", { enumerable: true, get: function () { return webpack_2.LoaderTargetPlugin; } });
|
|
84
|
+
Object.defineProperty(exports, "Module", { enumerable: true, get: function () { return webpack_2.Module; } });
|
|
85
|
+
Object.defineProperty(exports, "ModuleGraph", { enumerable: true, get: function () { return webpack_2.ModuleGraph; } });
|
|
86
|
+
Object.defineProperty(exports, "ModuleGraphConnection", { enumerable: true, get: function () { return webpack_2.ModuleGraphConnection; } });
|
|
87
|
+
Object.defineProperty(exports, "NoEmitOnErrorsPlugin", { enumerable: true, get: function () { return webpack_2.NoEmitOnErrorsPlugin; } });
|
|
88
|
+
Object.defineProperty(exports, "NormalModule", { enumerable: true, get: function () { return webpack_2.NormalModule; } });
|
|
89
|
+
Object.defineProperty(exports, "NormalModuleReplacementPlugin", { enumerable: true, get: function () { return webpack_2.NormalModuleReplacementPlugin; } });
|
|
90
|
+
Object.defineProperty(exports, "MultiCompiler", { enumerable: true, get: function () { return webpack_2.MultiCompiler; } });
|
|
91
|
+
Object.defineProperty(exports, "Parser", { enumerable: true, get: function () { return webpack_2.Parser; } });
|
|
92
|
+
Object.defineProperty(exports, "PrefetchPlugin", { enumerable: true, get: function () { return webpack_2.PrefetchPlugin; } });
|
|
93
|
+
Object.defineProperty(exports, "ProgressPlugin", { enumerable: true, get: function () { return webpack_2.ProgressPlugin; } });
|
|
94
|
+
Object.defineProperty(exports, "ProvidePlugin", { enumerable: true, get: function () { return webpack_2.ProvidePlugin; } });
|
|
95
|
+
Object.defineProperty(exports, "RuntimeModule", { enumerable: true, get: function () { return webpack_2.RuntimeModule; } });
|
|
96
|
+
Object.defineProperty(exports, "SingleEntryPlugin", { enumerable: true, get: function () { return webpack_2.EntryPlugin; } });
|
|
97
|
+
Object.defineProperty(exports, "SourceMapDevToolPlugin", { enumerable: true, get: function () { return webpack_2.SourceMapDevToolPlugin; } });
|
|
98
|
+
Object.defineProperty(exports, "Stats", { enumerable: true, get: function () { return webpack_2.Stats; } });
|
|
99
|
+
Object.defineProperty(exports, "Template", { enumerable: true, get: function () { return webpack_2.Template; } });
|
|
100
|
+
Object.defineProperty(exports, "WatchIgnorePlugin", { enumerable: true, get: function () { return webpack_2.WatchIgnorePlugin; } });
|
|
101
|
+
Object.defineProperty(exports, "WebpackError", { enumerable: true, get: function () { return webpack_2.WebpackError; } });
|
|
102
|
+
Object.defineProperty(exports, "WebpackOptionsApply", { enumerable: true, get: function () { return webpack_2.WebpackOptionsApply; } });
|
|
103
|
+
Object.defineProperty(exports, "WebpackOptionsDefaulter", { enumerable: true, get: function () { return webpack_2.WebpackOptionsDefaulter; } });
|
|
104
|
+
Object.defineProperty(exports, "MultiStats", { enumerable: true, get: function () { return webpack_2.MultiStats; } });
|
|
105
|
+
Object.defineProperty(exports, "Watching", { enumerable: true, get: function () { return webpack_2.Watching; } });
|
|
106
|
+
/**
|
|
107
|
+
* resolve webpack module for not shuvi plugin
|
|
108
|
+
*/
|
|
109
|
+
const webpackResolveContext = (0, path_1.join)((0, path_1.dirname)(require.resolve('webpack/package.json')), '../');
|
|
110
|
+
exports.webpackResolveContext = webpackResolveContext;
|