@teambit/webpack 0.0.881 → 0.0.883
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/config/html.js +2 -2
- package/dist/config/html.js.map +1 -1
- package/dist/config/webpack-fallbacks-aliases.js.map +1 -1
- package/dist/config/webpack-fallbacks-provide-plugin-config.js.map +1 -1
- package/dist/config/webpack-fallbacks.js +7 -28
- package/dist/config/webpack-fallbacks.js.map +1 -1
- package/dist/config/webpack.config.js +1 -45
- package/dist/config/webpack.config.js.map +1 -1
- package/dist/config/webpack.dev.config.js +14 -58
- package/dist/config/webpack.dev.config.js.map +1 -1
- package/dist/events/index.js +0 -4
- package/dist/events/index.js.map +1 -1
- package/dist/events/webpack-compilation-done-event.js +1 -12
- package/dist/events/webpack-compilation-done-event.js.map +1 -1
- package/dist/events/webpack-compilation-started-event.js +1 -10
- package/dist/events/webpack-compilation-started-event.js.map +1 -1
- package/dist/index.js +0 -35
- package/dist/index.js.map +1 -1
- package/dist/plugins/webpack-bit-reporter-plugin.js +4 -16
- package/dist/plugins/webpack-bit-reporter-plugin.js.map +1 -1
- package/dist/transformers/get-exposed-rules.js +0 -18
- package/dist/transformers/get-exposed-rules.js.map +1 -1
- package/dist/transformers/get-externals.js +0 -10
- package/dist/transformers/get-externals.js.map +1 -1
- package/dist/transformers/index.js +0 -9
- package/dist/transformers/index.js.map +1 -1
- package/dist/transformers/inject-body.js +0 -5
- package/dist/transformers/inject-body.js.map +1 -1
- package/dist/transformers/inject-head.js +0 -4
- package/dist/transformers/inject-head.js.map +1 -1
- package/dist/transformers/resolve-peer.js +2 -22
- package/dist/transformers/resolve-peer.js.map +1 -1
- package/dist/transformers/transformers.js +5 -20
- package/dist/transformers/transformers.js.map +1 -1
- package/dist/webpack.aspect.js +0 -5
- package/dist/webpack.aspect.js.map +1 -1
- package/dist/webpack.bundler.js +2 -33
- package/dist/webpack.bundler.js.map +1 -1
- package/dist/webpack.composition.js +0 -6
- package/dist/webpack.composition.js.map +1 -1
- package/dist/webpack.dev-server.js +8 -25
- package/dist/webpack.dev-server.js.map +1 -1
- package/dist/webpack.main.runtime.js +9 -74
- package/dist/webpack.main.runtime.js.map +1 -1
- package/package-tar/teambit-webpack-0.0.883.tgz +0 -0
- package/package.json +5 -5
- package/{preview-1666409808293.js → preview-1666582798766.js} +2 -2
- package/package-tar/teambit-webpack-0.0.881.tgz +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["publicUrlOrPath","getPublicUrlOrPath","process","env","NODE_ENV","configFactory","devServerID","workspaceDir","entryFiles","publicRoot","publicPath","pubsub","title","favicon","resolveWorkspacePath","relativePath","path","resolve","publicDirectory","mode","devtool","entry","map","filePath","output","filename","pathinfo","chunkFilename","devtoolModuleFilenameTemplate","info","pathNormalizeToLinux","absoluteResourcePath","infrastructureLogging","level","stats","errorDetails","devServer","allowedHosts","static","directory","staticOptions","serveIndex","watch","compress","hot","historyApiFallback","disableDotRule","index","client","overlay","onBeforeSetupMiddleware","wds","app","use","evalSourceMapMiddleware","errorOverlayMiddleware","onAfterSetupMiddleware","redirectServedPath","noopServiceWorkerMiddleware","devMiddleware","join","alias","fallbacksAliases","fallback","fallbacks","plugins","HtmlWebpackPlugin","templateContent","html","webpack","ProvidePlugin","fallbacksProvidePluginConfig","WebpackBitReporterPlugin","options"],"sources":["webpack.dev.config.ts"],"sourcesContent":["import path from 'path';\nimport webpack from 'webpack';\nimport HtmlWebpackPlugin from 'html-webpack-plugin';\nimport errorOverlayMiddleware from 'react-dev-utils/errorOverlayMiddleware';\nimport evalSourceMapMiddleware from 'react-dev-utils/evalSourceMapMiddleware';\nimport noopServiceWorkerMiddleware from 'react-dev-utils/noopServiceWorkerMiddleware';\nimport redirectServedPath from 'react-dev-utils/redirectServedPathMiddleware';\nimport getPublicUrlOrPath from 'react-dev-utils/getPublicUrlOrPath';\nimport { PubsubMain } from '@teambit/pubsub';\nimport { pathNormalizeToLinux } from '@teambit/legacy/dist/utils';\nimport { WebpackConfigWithDevServer } from '../webpack.dev-server';\nimport { fallbacks } from './webpack-fallbacks';\n\nimport { html } from './html';\n\nimport { WebpackBitReporterPlugin } from '../plugins/webpack-bit-reporter-plugin';\nimport { fallbacksProvidePluginConfig } from './webpack-fallbacks-provide-plugin-config';\nimport { fallbacksAliases } from './webpack-fallbacks-aliases';\n\nconst publicUrlOrPath = getPublicUrlOrPath(process.env.NODE_ENV === 'development', '/', '/public');\n\nexport function configFactory(\n devServerID: string,\n workspaceDir: string,\n entryFiles: string[],\n publicRoot: string,\n publicPath: string,\n pubsub: PubsubMain,\n title?: string,\n favicon?: string\n): WebpackConfigWithDevServer {\n const resolveWorkspacePath = (relativePath) => path.resolve(workspaceDir, relativePath);\n\n // Required for babel-preset-react-app\n process.env.NODE_ENV = 'development';\n\n const publicDirectory = `${publicRoot}/${publicPath}`;\n\n return {\n // Environment mode\n mode: 'development',\n\n devtool: 'inline-source-map',\n\n // Entry point of app\n entry: entryFiles.map((filePath) => resolveWorkspacePath(filePath)),\n\n output: {\n // Development filename output\n filename: 'static/js/[name].bundle.js',\n\n pathinfo: true,\n\n path: resolveWorkspacePath(publicDirectory),\n\n // publicPath: resolveWorkspacePath(publicDirectory),\n\n chunkFilename: 'static/js/[name].chunk.js',\n\n // point sourcemap entries to original disk locations (format as URL on windows)\n devtoolModuleFilenameTemplate: (info) => pathNormalizeToLinux(path.resolve(info.absoluteResourcePath)),\n\n // this defaults to 'window', but by setting it to 'this' then\n // module chunks which are built will work in web workers as well.\n // Commented out to use the default (self) as according to tobias with webpack5 self is working with workers as well\n // globalObject: 'this',\n },\n\n infrastructureLogging: {\n level: 'error',\n },\n\n stats: {\n errorDetails: true,\n },\n\n devServer: {\n allowedHosts: 'all',\n\n static: [\n {\n directory: resolveWorkspacePath(publicDirectory),\n staticOptions: {},\n // Don't be confused with `dev.publicPath`, it is `publicPath` for static directory\n // Can be:\n // publicPath: ['/static-public-path-one/', '/static-public-path-two/'],\n publicPath: publicDirectory,\n // Can be:\n // serveIndex: {} (options for the `serveIndex` option you can find https://github.com/expressjs/serve-index)\n serveIndex: true,\n // Can be:\n // watch: {} (options for the `watch` option you can find https://github.com/paulmillr/chokidar)\n watch: true,\n },\n ],\n\n // Enable compression\n compress: true,\n\n // Enable hot reloading\n hot: true,\n\n historyApiFallback: {\n disableDotRule: true,\n index: resolveWorkspacePath(publicDirectory),\n },\n\n client: {\n overlay: false,\n },\n\n onBeforeSetupMiddleware(wds) {\n const { app } = wds;\n // Keep `evalSourceMapMiddleware` and `errorOverlayMiddleware`\n // middlewares before `redirectServedPath` otherwise will not have any effect\n // This lets us fetch source contents from webpack for the error overlay\n // @ts-ignore - @types/WDS mismatch - 3.11.6 vs 4.0.3\n app.use(evalSourceMapMiddleware(wds));\n // This lets us open files from the runtime error overlay.\n app.use(errorOverlayMiddleware());\n },\n\n onAfterSetupMiddleware({ app }) {\n // Redirect to `PUBLIC_URL` or `homepage` from `package.json` if url not match\n app.use(redirectServedPath(publicUrlOrPath));\n\n // This service worker file is effectively a 'no-op' that will reset any\n // previous service worker registered for the same host:port combination.\n // We do this in development to avoid hitting the production cache if\n // it used the same host and port.\n // https://github.com/facebook/create-react-app/issues/2272#issuecomment-302832432\n app.use(noopServiceWorkerMiddleware(publicUrlOrPath));\n },\n\n devMiddleware: {\n // forward static files\n publicPath: path.join('/', publicRoot),\n },\n },\n\n resolve: {\n // TODO - check - we shoult not need both fallbacks and alias and provider plugin\n alias: fallbacksAliases,\n\n fallback: fallbacks as any,\n },\n\n plugins: [\n new HtmlWebpackPlugin({\n templateContent: html(title || 'Component preview'),\n filename: 'index.html',\n favicon,\n }),\n new webpack.ProvidePlugin(fallbacksProvidePluginConfig),\n\n new WebpackBitReporterPlugin({\n options: { pubsub, devServerID },\n }),\n ],\n };\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"names":["publicUrlOrPath","getPublicUrlOrPath","process","env","NODE_ENV","configFactory","devServerID","workspaceDir","entryFiles","publicRoot","publicPath","pubsub","title","favicon","resolveWorkspacePath","relativePath","path","resolve","publicDirectory","mode","devtool","entry","map","filePath","output","filename","pathinfo","chunkFilename","devtoolModuleFilenameTemplate","info","pathNormalizeToLinux","absoluteResourcePath","infrastructureLogging","level","stats","errorDetails","devServer","allowedHosts","static","directory","staticOptions","serveIndex","watch","compress","hot","historyApiFallback","disableDotRule","index","client","overlay","onBeforeSetupMiddleware","wds","app","use","evalSourceMapMiddleware","errorOverlayMiddleware","onAfterSetupMiddleware","redirectServedPath","noopServiceWorkerMiddleware","devMiddleware","join","alias","fallbacksAliases","fallback","fallbacks","plugins","HtmlWebpackPlugin","templateContent","html","webpack","ProvidePlugin","fallbacksProvidePluginConfig","WebpackBitReporterPlugin","options"],"sources":["webpack.dev.config.ts"],"sourcesContent":["import path from 'path';\nimport webpack from 'webpack';\nimport HtmlWebpackPlugin from 'html-webpack-plugin';\nimport errorOverlayMiddleware from 'react-dev-utils/errorOverlayMiddleware';\nimport evalSourceMapMiddleware from 'react-dev-utils/evalSourceMapMiddleware';\nimport noopServiceWorkerMiddleware from 'react-dev-utils/noopServiceWorkerMiddleware';\nimport redirectServedPath from 'react-dev-utils/redirectServedPathMiddleware';\nimport getPublicUrlOrPath from 'react-dev-utils/getPublicUrlOrPath';\nimport { PubsubMain } from '@teambit/pubsub';\nimport { pathNormalizeToLinux } from '@teambit/legacy/dist/utils';\nimport { WebpackConfigWithDevServer } from '../webpack.dev-server';\nimport { fallbacks } from './webpack-fallbacks';\n\nimport { html } from './html';\n\nimport { WebpackBitReporterPlugin } from '../plugins/webpack-bit-reporter-plugin';\nimport { fallbacksProvidePluginConfig } from './webpack-fallbacks-provide-plugin-config';\nimport { fallbacksAliases } from './webpack-fallbacks-aliases';\n\nconst publicUrlOrPath = getPublicUrlOrPath(process.env.NODE_ENV === 'development', '/', '/public');\n\nexport function configFactory(\n devServerID: string,\n workspaceDir: string,\n entryFiles: string[],\n publicRoot: string,\n publicPath: string,\n pubsub: PubsubMain,\n title?: string,\n favicon?: string\n): WebpackConfigWithDevServer {\n const resolveWorkspacePath = (relativePath) => path.resolve(workspaceDir, relativePath);\n\n // Required for babel-preset-react-app\n process.env.NODE_ENV = 'development';\n\n const publicDirectory = `${publicRoot}/${publicPath}`;\n\n return {\n // Environment mode\n mode: 'development',\n\n devtool: 'inline-source-map',\n\n // Entry point of app\n entry: entryFiles.map((filePath) => resolveWorkspacePath(filePath)),\n\n output: {\n // Development filename output\n filename: 'static/js/[name].bundle.js',\n\n pathinfo: true,\n\n path: resolveWorkspacePath(publicDirectory),\n\n // publicPath: resolveWorkspacePath(publicDirectory),\n\n chunkFilename: 'static/js/[name].chunk.js',\n\n // point sourcemap entries to original disk locations (format as URL on windows)\n devtoolModuleFilenameTemplate: (info) => pathNormalizeToLinux(path.resolve(info.absoluteResourcePath)),\n\n // this defaults to 'window', but by setting it to 'this' then\n // module chunks which are built will work in web workers as well.\n // Commented out to use the default (self) as according to tobias with webpack5 self is working with workers as well\n // globalObject: 'this',\n },\n\n infrastructureLogging: {\n level: 'error',\n },\n\n stats: {\n errorDetails: true,\n },\n\n devServer: {\n allowedHosts: 'all',\n\n static: [\n {\n directory: resolveWorkspacePath(publicDirectory),\n staticOptions: {},\n // Don't be confused with `dev.publicPath`, it is `publicPath` for static directory\n // Can be:\n // publicPath: ['/static-public-path-one/', '/static-public-path-two/'],\n publicPath: publicDirectory,\n // Can be:\n // serveIndex: {} (options for the `serveIndex` option you can find https://github.com/expressjs/serve-index)\n serveIndex: true,\n // Can be:\n // watch: {} (options for the `watch` option you can find https://github.com/paulmillr/chokidar)\n watch: true,\n },\n ],\n\n // Enable compression\n compress: true,\n\n // Enable hot reloading\n hot: true,\n\n historyApiFallback: {\n disableDotRule: true,\n index: resolveWorkspacePath(publicDirectory),\n },\n\n client: {\n overlay: false,\n },\n\n onBeforeSetupMiddleware(wds) {\n const { app } = wds;\n // Keep `evalSourceMapMiddleware` and `errorOverlayMiddleware`\n // middlewares before `redirectServedPath` otherwise will not have any effect\n // This lets us fetch source contents from webpack for the error overlay\n // @ts-ignore - @types/WDS mismatch - 3.11.6 vs 4.0.3\n app.use(evalSourceMapMiddleware(wds));\n // This lets us open files from the runtime error overlay.\n app.use(errorOverlayMiddleware());\n },\n\n onAfterSetupMiddleware({ app }) {\n // Redirect to `PUBLIC_URL` or `homepage` from `package.json` if url not match\n app.use(redirectServedPath(publicUrlOrPath));\n\n // This service worker file is effectively a 'no-op' that will reset any\n // previous service worker registered for the same host:port combination.\n // We do this in development to avoid hitting the production cache if\n // it used the same host and port.\n // https://github.com/facebook/create-react-app/issues/2272#issuecomment-302832432\n app.use(noopServiceWorkerMiddleware(publicUrlOrPath));\n },\n\n devMiddleware: {\n // forward static files\n publicPath: path.join('/', publicRoot),\n },\n },\n\n resolve: {\n // TODO - check - we shoult not need both fallbacks and alias and provider plugin\n alias: fallbacksAliases,\n\n fallback: fallbacks as any,\n },\n\n plugins: [\n new HtmlWebpackPlugin({\n templateContent: html(title || 'Component preview'),\n filename: 'index.html',\n favicon,\n }),\n new webpack.ProvidePlugin(fallbacksProvidePluginConfig),\n\n new WebpackBitReporterPlugin({\n options: { pubsub, devServerID },\n }),\n ],\n };\n}\n"],"mappings":"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"}
|
package/dist/events/index.js
CHANGED
|
@@ -3,9 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
|
|
7
6
|
var _webpackCompilationDoneEvent = require("./webpack-compilation-done-event");
|
|
8
|
-
|
|
9
7
|
Object.keys(_webpackCompilationDoneEvent).forEach(function (key) {
|
|
10
8
|
if (key === "default" || key === "__esModule") return;
|
|
11
9
|
if (key in exports && exports[key] === _webpackCompilationDoneEvent[key]) return;
|
|
@@ -16,9 +14,7 @@ Object.keys(_webpackCompilationDoneEvent).forEach(function (key) {
|
|
|
16
14
|
}
|
|
17
15
|
});
|
|
18
16
|
});
|
|
19
|
-
|
|
20
17
|
var _webpackCompilationStartedEvent = require("./webpack-compilation-started-event");
|
|
21
|
-
|
|
22
18
|
Object.keys(_webpackCompilationStartedEvent).forEach(function (key) {
|
|
23
19
|
if (key === "default" || key === "__esModule") return;
|
|
24
20
|
if (key in exports && exports[key] === _webpackCompilationStartedEvent[key]) return;
|
package/dist/events/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["index.ts"],"sourcesContent":["export * from './webpack-compilation-done-event';\nexport * from './webpack-compilation-started-event';\n"],"mappings":"
|
|
1
|
+
{"version":3,"names":[],"sources":["index.ts"],"sourcesContent":["export * from './webpack-compilation-done-event';\nexport * from './webpack-compilation-started-event';\n"],"mappings":";;;;;AAAA;AAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;AACA;AAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA"}
|
|
@@ -1,41 +1,32 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
4
|
Object.defineProperty(exports, "__esModule", {
|
|
6
5
|
value: true
|
|
7
6
|
});
|
|
8
7
|
exports.WebpackCompilationDoneEvent = void 0;
|
|
9
|
-
|
|
10
8
|
function _defineProperty2() {
|
|
11
9
|
const data = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
12
|
-
|
|
13
10
|
_defineProperty2 = function () {
|
|
14
11
|
return data;
|
|
15
12
|
};
|
|
16
|
-
|
|
17
13
|
return data;
|
|
18
14
|
}
|
|
19
|
-
|
|
20
15
|
function _pubsub() {
|
|
21
16
|
const data = require("@teambit/pubsub");
|
|
22
|
-
|
|
23
17
|
_pubsub = function () {
|
|
24
18
|
return data;
|
|
25
19
|
};
|
|
26
|
-
|
|
27
20
|
return data;
|
|
28
21
|
}
|
|
29
|
-
|
|
30
22
|
/* eslint-disable max-classes-per-file */
|
|
23
|
+
|
|
31
24
|
class WebpackCompilationDoneEventData {
|
|
32
25
|
constructor(stats, devServerID) {
|
|
33
26
|
this.stats = stats;
|
|
34
27
|
this.devServerID = devServerID;
|
|
35
28
|
}
|
|
36
|
-
|
|
37
29
|
}
|
|
38
|
-
|
|
39
30
|
class WebpackCompilationDoneEvent extends _pubsub().BitBaseEvent {
|
|
40
31
|
constructor(timestamp, stats, devServerID) {
|
|
41
32
|
super(WebpackCompilationDoneEvent.TYPE, '0.0.1', timestamp, new WebpackCompilationDoneEventData(stats, devServerID));
|
|
@@ -43,9 +34,7 @@ class WebpackCompilationDoneEvent extends _pubsub().BitBaseEvent {
|
|
|
43
34
|
this.stats = stats;
|
|
44
35
|
this.devServerID = devServerID;
|
|
45
36
|
}
|
|
46
|
-
|
|
47
37
|
}
|
|
48
|
-
|
|
49
38
|
exports.WebpackCompilationDoneEvent = WebpackCompilationDoneEvent;
|
|
50
39
|
(0, _defineProperty2().default)(WebpackCompilationDoneEvent, "TYPE", 'webpack-compilation-done');
|
|
51
40
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["WebpackCompilationDoneEventData","constructor","stats","devServerID","WebpackCompilationDoneEvent","BitBaseEvent","timestamp","TYPE"],"sources":["webpack-compilation-done-event.ts"],"sourcesContent":["/* eslint-disable max-classes-per-file */\nimport type { Stats } from 'webpack';\nimport { BitBaseEvent } from '@teambit/pubsub';\n\nclass WebpackCompilationDoneEventData {\n constructor(readonly stats: Stats, readonly devServerID: string) {}\n}\n\nexport class WebpackCompilationDoneEvent extends BitBaseEvent<WebpackCompilationDoneEventData> {\n static readonly TYPE = 'webpack-compilation-done';\n\n constructor(readonly timestamp: number, readonly stats: Stats, readonly devServerID: string) {\n super(\n WebpackCompilationDoneEvent.TYPE,\n '0.0.1',\n timestamp,\n new WebpackCompilationDoneEventData(stats, devServerID)\n );\n }\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"names":["WebpackCompilationDoneEventData","constructor","stats","devServerID","WebpackCompilationDoneEvent","BitBaseEvent","timestamp","TYPE"],"sources":["webpack-compilation-done-event.ts"],"sourcesContent":["/* eslint-disable max-classes-per-file */\nimport type { Stats } from 'webpack';\nimport { BitBaseEvent } from '@teambit/pubsub';\n\nclass WebpackCompilationDoneEventData {\n constructor(readonly stats: Stats, readonly devServerID: string) {}\n}\n\nexport class WebpackCompilationDoneEvent extends BitBaseEvent<WebpackCompilationDoneEventData> {\n static readonly TYPE = 'webpack-compilation-done';\n\n constructor(readonly timestamp: number, readonly stats: Stats, readonly devServerID: string) {\n super(\n WebpackCompilationDoneEvent.TYPE,\n '0.0.1',\n timestamp,\n new WebpackCompilationDoneEventData(stats, devServerID)\n );\n }\n}\n"],"mappings":";;;;;;;;;;;;;;AAEA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAFA;;AAIA,MAAMA,+BAA+B,CAAC;EACpCC,WAAW,CAAUC,KAAY,EAAWC,WAAmB,EAAE;IAAA,KAA5CD,KAAY,GAAZA,KAAY;IAAA,KAAWC,WAAmB,GAAnBA,WAAmB;EAAG;AACpE;AAEO,MAAMC,2BAA2B,SAASC,sBAAY,CAAkC;EAG7FJ,WAAW,CAAUK,SAAiB,EAAWJ,KAAY,EAAWC,WAAmB,EAAE;IAC3F,KAAK,CACHC,2BAA2B,CAACG,IAAI,EAChC,OAAO,EACPD,SAAS,EACT,IAAIN,+BAA+B,CAACE,KAAK,EAAEC,WAAW,CAAC,CACxD;IAAC,KANiBG,SAAiB,GAAjBA,SAAiB;IAAA,KAAWJ,KAAY,GAAZA,KAAY;IAAA,KAAWC,WAAmB,GAAnBA,WAAmB;EAO3F;AACF;AAAC;AAAA,gCAXYC,2BAA2B,UACf,0BAA0B"}
|
|
@@ -1,42 +1,33 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
4
|
Object.defineProperty(exports, "__esModule", {
|
|
6
5
|
value: true
|
|
7
6
|
});
|
|
8
7
|
exports.WebpackCompilationStartedEvent = void 0;
|
|
9
|
-
|
|
10
8
|
function _defineProperty2() {
|
|
11
9
|
const data = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
12
|
-
|
|
13
10
|
_defineProperty2 = function () {
|
|
14
11
|
return data;
|
|
15
12
|
};
|
|
16
|
-
|
|
17
13
|
return data;
|
|
18
14
|
}
|
|
19
|
-
|
|
20
15
|
function _pubsub() {
|
|
21
16
|
const data = require("@teambit/pubsub");
|
|
22
|
-
|
|
23
17
|
_pubsub = function () {
|
|
24
18
|
return data;
|
|
25
19
|
};
|
|
26
|
-
|
|
27
20
|
return data;
|
|
28
21
|
}
|
|
29
|
-
|
|
30
22
|
/* eslint-disable max-classes-per-file */
|
|
23
|
+
|
|
31
24
|
class WebpackCompilationStartedEvent extends _pubsub().BitBaseEvent {
|
|
32
25
|
constructor(timestamp, params) {
|
|
33
26
|
super(WebpackCompilationStartedEvent.TYPE, '0.0.1', timestamp, params);
|
|
34
27
|
this.timestamp = timestamp;
|
|
35
28
|
this.params = params;
|
|
36
29
|
}
|
|
37
|
-
|
|
38
30
|
}
|
|
39
|
-
|
|
40
31
|
exports.WebpackCompilationStartedEvent = WebpackCompilationStartedEvent;
|
|
41
32
|
(0, _defineProperty2().default)(WebpackCompilationStartedEvent, "TYPE", 'webpack-compilation-started');
|
|
42
33
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["WebpackCompilationStartedEvent","BitBaseEvent","constructor","timestamp","params","TYPE"],"sources":["webpack-compilation-started-event.ts"],"sourcesContent":["/* eslint-disable max-classes-per-file */\nimport { BitBaseEvent } from '@teambit/pubsub';\n\ntype Params = {\n devServerID: string;\n};\n\nexport class WebpackCompilationStartedEvent extends BitBaseEvent<Params> {\n static readonly TYPE = 'webpack-compilation-started';\n\n constructor(readonly timestamp, readonly params: Params) {\n super(WebpackCompilationStartedEvent.TYPE, '0.0.1', timestamp, params);\n }\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"names":["WebpackCompilationStartedEvent","BitBaseEvent","constructor","timestamp","params","TYPE"],"sources":["webpack-compilation-started-event.ts"],"sourcesContent":["/* eslint-disable max-classes-per-file */\nimport { BitBaseEvent } from '@teambit/pubsub';\n\ntype Params = {\n devServerID: string;\n};\n\nexport class WebpackCompilationStartedEvent extends BitBaseEvent<Params> {\n static readonly TYPE = 'webpack-compilation-started';\n\n constructor(readonly timestamp, readonly params: Params) {\n super(WebpackCompilationStartedEvent.TYPE, '0.0.1', timestamp, params);\n }\n}\n"],"mappings":";;;;;;;;;;;;;;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AADA;;AAOO,MAAMA,8BAA8B,SAASC,sBAAY,CAAS;EAGvEC,WAAW,CAAUC,SAAS,EAAWC,MAAc,EAAE;IACvD,KAAK,CAACJ,8BAA8B,CAACK,IAAI,EAAE,OAAO,EAAEF,SAAS,EAAEC,MAAM,CAAC;IAAC,KADpDD,SAAS,GAATA,SAAS;IAAA,KAAWC,MAAc,GAAdA,MAAc;EAEvD;AACF;AAAC;AAAA,gCANYJ,8BAA8B,UAClB,6BAA6B"}
|
package/dist/index.js
CHANGED
|
@@ -124,49 +124,35 @@ Object.defineProperty(exports, "runTransformersWithContext", {
|
|
|
124
124
|
return _webpackMain().runTransformersWithContext;
|
|
125
125
|
}
|
|
126
126
|
});
|
|
127
|
-
|
|
128
127
|
function _webpackMain() {
|
|
129
128
|
const data = require("./webpack.main.runtime");
|
|
130
|
-
|
|
131
129
|
_webpackMain = function () {
|
|
132
130
|
return data;
|
|
133
131
|
};
|
|
134
|
-
|
|
135
132
|
return data;
|
|
136
133
|
}
|
|
137
|
-
|
|
138
134
|
function _webpack() {
|
|
139
135
|
const data = require("./webpack.aspect");
|
|
140
|
-
|
|
141
136
|
_webpack = function () {
|
|
142
137
|
return data;
|
|
143
138
|
};
|
|
144
|
-
|
|
145
139
|
return data;
|
|
146
140
|
}
|
|
147
|
-
|
|
148
141
|
function _webpack2() {
|
|
149
142
|
const data = require("./webpack.dev-server");
|
|
150
|
-
|
|
151
143
|
_webpack2 = function () {
|
|
152
144
|
return data;
|
|
153
145
|
};
|
|
154
|
-
|
|
155
146
|
return data;
|
|
156
147
|
}
|
|
157
|
-
|
|
158
148
|
function _webpack3() {
|
|
159
149
|
const data = require("./webpack.bundler");
|
|
160
|
-
|
|
161
150
|
_webpack3 = function () {
|
|
162
151
|
return data;
|
|
163
152
|
};
|
|
164
|
-
|
|
165
153
|
return data;
|
|
166
154
|
}
|
|
167
|
-
|
|
168
155
|
var _events = require("./events");
|
|
169
|
-
|
|
170
156
|
Object.keys(_events).forEach(function (key) {
|
|
171
157
|
if (key === "default" || key === "__esModule") return;
|
|
172
158
|
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
@@ -178,74 +164,53 @@ Object.keys(_events).forEach(function (key) {
|
|
|
178
164
|
}
|
|
179
165
|
});
|
|
180
166
|
});
|
|
181
|
-
|
|
182
167
|
function _webpack4() {
|
|
183
168
|
const data = require("webpack");
|
|
184
|
-
|
|
185
169
|
_webpack4 = function () {
|
|
186
170
|
return data;
|
|
187
171
|
};
|
|
188
|
-
|
|
189
172
|
return data;
|
|
190
173
|
}
|
|
191
|
-
|
|
192
174
|
function _webpackModules() {
|
|
193
175
|
const data = require("@teambit/webpack.modules.config-mutator");
|
|
194
|
-
|
|
195
176
|
_webpackModules = function () {
|
|
196
177
|
return data;
|
|
197
178
|
};
|
|
198
|
-
|
|
199
179
|
return data;
|
|
200
180
|
}
|
|
201
|
-
|
|
202
181
|
function _webpackBitReporterPlugin() {
|
|
203
182
|
const data = require("./plugins/webpack-bit-reporter-plugin");
|
|
204
|
-
|
|
205
183
|
_webpackBitReporterPlugin = function () {
|
|
206
184
|
return data;
|
|
207
185
|
};
|
|
208
|
-
|
|
209
186
|
return data;
|
|
210
187
|
}
|
|
211
|
-
|
|
212
188
|
function _webpackFallbacks() {
|
|
213
189
|
const data = require("./config/webpack-fallbacks");
|
|
214
|
-
|
|
215
190
|
_webpackFallbacks = function () {
|
|
216
191
|
return data;
|
|
217
192
|
};
|
|
218
|
-
|
|
219
193
|
return data;
|
|
220
194
|
}
|
|
221
|
-
|
|
222
195
|
function _webpackFallbacksAliases() {
|
|
223
196
|
const data = require("./config/webpack-fallbacks-aliases");
|
|
224
|
-
|
|
225
197
|
_webpackFallbacksAliases = function () {
|
|
226
198
|
return data;
|
|
227
199
|
};
|
|
228
|
-
|
|
229
200
|
return data;
|
|
230
201
|
}
|
|
231
|
-
|
|
232
202
|
function _webpackFallbacksProvidePluginConfig() {
|
|
233
203
|
const data = require("./config/webpack-fallbacks-provide-plugin-config");
|
|
234
|
-
|
|
235
204
|
_webpackFallbacksProvidePluginConfig = function () {
|
|
236
205
|
return data;
|
|
237
206
|
};
|
|
238
|
-
|
|
239
207
|
return data;
|
|
240
208
|
}
|
|
241
|
-
|
|
242
209
|
function _transformers() {
|
|
243
210
|
const data = require("./transformers");
|
|
244
|
-
|
|
245
211
|
_transformers = function () {
|
|
246
212
|
return data;
|
|
247
213
|
};
|
|
248
|
-
|
|
249
214
|
return data;
|
|
250
215
|
}
|
|
251
216
|
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["index.ts"],"sourcesContent":["export type {\n WebpackMain,\n WebpackConfigTransformer,\n WebpackConfigTransformContext,\n WebpackConfigDevServerTransformContext,\n GlobalWebpackConfigTransformContext,\n WebpackConfigDevServerTransformer,\n} from './webpack.main.runtime';\nexport { runTransformersWithContext } from './webpack.main.runtime';\nexport { WebpackAspect } from './webpack.aspect';\nexport { WebpackDevServer } from './webpack.dev-server';\nexport { WebpackBundler } from './webpack.bundler';\nexport type { WebpackConfigWithDevServer } from './webpack.dev-server';\nexport * from './events';\nexport { Configuration } from 'webpack';\nexport { WebpackConfigMutator } from '@teambit/webpack.modules.config-mutator';\nexport { WebpackBitReporterPlugin } from './plugins/webpack-bit-reporter-plugin';\nexport { fallbacks } from './config/webpack-fallbacks';\nexport { fallbacksAliases } from './config/webpack-fallbacks-aliases';\nexport { fallbacksProvidePluginConfig } from './config/webpack-fallbacks-provide-plugin-config';\nexport {\n GenerateBodyInjectionTransformer,\n BodyInjectionOptions,\n generateAddAliasesFromPeersTransformer,\n generateExposePeersTransformer,\n generateExternalsTransformer,\n GenerateHeadInjectionTransformer,\n HeadInjectionOptions,\n} from './transformers';\n"],"mappings":"
|
|
1
|
+
{"version":3,"names":[],"sources":["index.ts"],"sourcesContent":["export type {\n WebpackMain,\n WebpackConfigTransformer,\n WebpackConfigTransformContext,\n WebpackConfigDevServerTransformContext,\n GlobalWebpackConfigTransformContext,\n WebpackConfigDevServerTransformer,\n} from './webpack.main.runtime';\nexport { runTransformersWithContext } from './webpack.main.runtime';\nexport { WebpackAspect } from './webpack.aspect';\nexport { WebpackDevServer } from './webpack.dev-server';\nexport { WebpackBundler } from './webpack.bundler';\nexport type { WebpackConfigWithDevServer } from './webpack.dev-server';\nexport * from './events';\nexport { Configuration } from 'webpack';\nexport { WebpackConfigMutator } from '@teambit/webpack.modules.config-mutator';\nexport { WebpackBitReporterPlugin } from './plugins/webpack-bit-reporter-plugin';\nexport { fallbacks } from './config/webpack-fallbacks';\nexport { fallbacksAliases } from './config/webpack-fallbacks-aliases';\nexport { fallbacksProvidePluginConfig } from './config/webpack-fallbacks-provide-plugin-config';\nexport {\n GenerateBodyInjectionTransformer,\n BodyInjectionOptions,\n generateAddAliasesFromPeersTransformer,\n generateExposePeersTransformer,\n generateExternalsTransformer,\n GenerateHeadInjectionTransformer,\n HeadInjectionOptions,\n} from './transformers';\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAQA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAEA;AAAA;EAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA"}
|
|
@@ -1,49 +1,39 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
4
|
Object.defineProperty(exports, "__esModule", {
|
|
6
5
|
value: true
|
|
7
6
|
});
|
|
8
7
|
exports.WebpackBitReporterPlugin = void 0;
|
|
9
|
-
|
|
10
8
|
function _defineProperty2() {
|
|
11
9
|
const data = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
12
|
-
|
|
13
10
|
_defineProperty2 = function () {
|
|
14
11
|
return data;
|
|
15
12
|
};
|
|
16
|
-
|
|
17
13
|
return data;
|
|
18
14
|
}
|
|
19
|
-
|
|
20
15
|
function _events() {
|
|
21
16
|
const data = require("../events");
|
|
22
|
-
|
|
23
17
|
_events = function () {
|
|
24
18
|
return data;
|
|
25
19
|
};
|
|
26
|
-
|
|
27
20
|
return data;
|
|
28
21
|
}
|
|
29
|
-
|
|
30
22
|
function _webpack() {
|
|
31
23
|
const data = require("../webpack.aspect");
|
|
32
|
-
|
|
33
24
|
_webpack = function () {
|
|
34
25
|
return data;
|
|
35
26
|
};
|
|
36
|
-
|
|
37
27
|
return data;
|
|
38
28
|
}
|
|
39
|
-
|
|
40
29
|
const PLUGIN_NAME = 'webpack-compiler-started-plugin';
|
|
30
|
+
|
|
41
31
|
/**
|
|
42
32
|
* Monitors Webpack's compilation, and updates progress to Bit
|
|
43
33
|
*/
|
|
44
|
-
|
|
45
34
|
class WebpackBitReporterPlugin {
|
|
46
35
|
// TODO: add plugin type from webpack and implement it
|
|
36
|
+
|
|
47
37
|
constructor({
|
|
48
38
|
options
|
|
49
39
|
}) {
|
|
@@ -52,7 +42,6 @@ class WebpackBitReporterPlugin {
|
|
|
52
42
|
this.pubsub = options.pubsub;
|
|
53
43
|
this.devServerID = options.devServerID;
|
|
54
44
|
}
|
|
55
|
-
|
|
56
45
|
apply(compiler) {
|
|
57
46
|
// "Called before a new compilation is created."
|
|
58
47
|
compiler.hooks.compile.tap(PLUGIN_NAME, () => {
|
|
@@ -60,16 +49,15 @@ class WebpackBitReporterPlugin {
|
|
|
60
49
|
devServerID: this.devServerID
|
|
61
50
|
});
|
|
62
51
|
this.pubsub.pub(_webpack().WebpackAspect.id, event);
|
|
63
|
-
});
|
|
52
|
+
});
|
|
64
53
|
|
|
54
|
+
// "Executed when the compilation has completed."
|
|
65
55
|
compiler.hooks.done.tap(PLUGIN_NAME, stats => {
|
|
66
56
|
const event = new (_events().WebpackCompilationDoneEvent)(Date.now(), stats, this.devServerID);
|
|
67
57
|
this.pubsub.pub(_webpack().WebpackAspect.id, event);
|
|
68
58
|
});
|
|
69
59
|
}
|
|
70
|
-
|
|
71
60
|
}
|
|
72
|
-
|
|
73
61
|
exports.WebpackBitReporterPlugin = WebpackBitReporterPlugin;
|
|
74
62
|
|
|
75
63
|
//# sourceMappingURL=webpack-bit-reporter-plugin.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["PLUGIN_NAME","WebpackBitReporterPlugin","constructor","options","pubsub","devServerID","apply","compiler","hooks","compile","tap","event","WebpackCompilationStartedEvent","Date","now","pub","WebpackAspect","id","done","stats","WebpackCompilationDoneEvent"],"sources":["webpack-bit-reporter-plugin.ts"],"sourcesContent":["import type { Compiler, Stats } from 'webpack';\nimport { WebpackCompilationDoneEvent, WebpackCompilationStartedEvent } from '../events';\nimport { WebpackAspect } from '../webpack.aspect';\n\nconst PLUGIN_NAME = 'webpack-compiler-started-plugin';\n\n/**\n * Monitors Webpack's compilation, and updates progress to Bit\n */\nexport class WebpackBitReporterPlugin {\n // TODO: add plugin type from webpack and implement it\n pubsub: any;\n devServerID: string;\n\n constructor({ options }) {\n this.pubsub = options.pubsub;\n this.devServerID = options.devServerID;\n }\n\n apply(compiler: Compiler) {\n // \"Called before a new compilation is created.\"\n compiler.hooks.compile.tap(PLUGIN_NAME, () => {\n const event = new WebpackCompilationStartedEvent(Date.now(), { devServerID: this.devServerID });\n this.pubsub.pub(WebpackAspect.id, event);\n });\n\n // \"Executed when the compilation has completed.\"\n compiler.hooks.done.tap(PLUGIN_NAME, (stats: Stats) => {\n const event = new WebpackCompilationDoneEvent(Date.now(), stats, this.devServerID);\n this.pubsub.pub(WebpackAspect.id, event);\n });\n }\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"names":["PLUGIN_NAME","WebpackBitReporterPlugin","constructor","options","pubsub","devServerID","apply","compiler","hooks","compile","tap","event","WebpackCompilationStartedEvent","Date","now","pub","WebpackAspect","id","done","stats","WebpackCompilationDoneEvent"],"sources":["webpack-bit-reporter-plugin.ts"],"sourcesContent":["import type { Compiler, Stats } from 'webpack';\nimport { WebpackCompilationDoneEvent, WebpackCompilationStartedEvent } from '../events';\nimport { WebpackAspect } from '../webpack.aspect';\n\nconst PLUGIN_NAME = 'webpack-compiler-started-plugin';\n\n/**\n * Monitors Webpack's compilation, and updates progress to Bit\n */\nexport class WebpackBitReporterPlugin {\n // TODO: add plugin type from webpack and implement it\n pubsub: any;\n devServerID: string;\n\n constructor({ options }) {\n this.pubsub = options.pubsub;\n this.devServerID = options.devServerID;\n }\n\n apply(compiler: Compiler) {\n // \"Called before a new compilation is created.\"\n compiler.hooks.compile.tap(PLUGIN_NAME, () => {\n const event = new WebpackCompilationStartedEvent(Date.now(), { devServerID: this.devServerID });\n this.pubsub.pub(WebpackAspect.id, event);\n });\n\n // \"Executed when the compilation has completed.\"\n compiler.hooks.done.tap(PLUGIN_NAME, (stats: Stats) => {\n const event = new WebpackCompilationDoneEvent(Date.now(), stats, this.devServerID);\n this.pubsub.pub(WebpackAspect.id, event);\n });\n }\n}\n"],"mappings":";;;;;;;;;;;;;;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAEA,MAAMA,WAAW,GAAG,iCAAiC;;AAErD;AACA;AACA;AACO,MAAMC,wBAAwB,CAAC;EACpC;;EAIAC,WAAW,CAAC;IAAEC;EAAQ,CAAC,EAAE;IAAA;IAAA;IACvB,IAAI,CAACC,MAAM,GAAGD,OAAO,CAACC,MAAM;IAC5B,IAAI,CAACC,WAAW,GAAGF,OAAO,CAACE,WAAW;EACxC;EAEAC,KAAK,CAACC,QAAkB,EAAE;IACxB;IACAA,QAAQ,CAACC,KAAK,CAACC,OAAO,CAACC,GAAG,CAACV,WAAW,EAAE,MAAM;MAC5C,MAAMW,KAAK,GAAG,KAAIC,wCAA8B,EAACC,IAAI,CAACC,GAAG,EAAE,EAAE;QAAET,WAAW,EAAE,IAAI,CAACA;MAAY,CAAC,CAAC;MAC/F,IAAI,CAACD,MAAM,CAACW,GAAG,CAACC,wBAAa,CAACC,EAAE,EAAEN,KAAK,CAAC;IAC1C,CAAC,CAAC;;IAEF;IACAJ,QAAQ,CAACC,KAAK,CAACU,IAAI,CAACR,GAAG,CAACV,WAAW,EAAGmB,KAAY,IAAK;MACrD,MAAMR,KAAK,GAAG,KAAIS,qCAA2B,EAACP,IAAI,CAACC,GAAG,EAAE,EAAEK,KAAK,EAAE,IAAI,CAACd,WAAW,CAAC;MAClF,IAAI,CAACD,MAAM,CAACW,GAAG,CAACC,wBAAa,CAACC,EAAE,EAAEN,KAAK,CAAC;IAC1C,CAAC,CAAC;EACJ;AACF;AAAC"}
|
|
@@ -1,61 +1,43 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
4
|
require("core-js/modules/es.regexp.exec.js");
|
|
6
|
-
|
|
7
5
|
require("core-js/modules/es.string.replace.js");
|
|
8
|
-
|
|
9
6
|
Object.defineProperty(exports, "__esModule", {
|
|
10
7
|
value: true
|
|
11
8
|
});
|
|
12
9
|
exports.getExposedRules = getExposedRules;
|
|
13
|
-
|
|
14
10
|
function _camelcase() {
|
|
15
11
|
const data = _interopRequireDefault(require("camelcase"));
|
|
16
|
-
|
|
17
12
|
_camelcase = function () {
|
|
18
13
|
return data;
|
|
19
14
|
};
|
|
20
|
-
|
|
21
15
|
return data;
|
|
22
16
|
}
|
|
23
|
-
|
|
24
17
|
require("expose-loader");
|
|
25
|
-
|
|
26
18
|
function _webpackModules() {
|
|
27
19
|
const data = require("@teambit/webpack.modules.generate-expose-loaders");
|
|
28
|
-
|
|
29
20
|
_webpackModules = function () {
|
|
30
21
|
return data;
|
|
31
22
|
};
|
|
32
|
-
|
|
33
23
|
return data;
|
|
34
24
|
}
|
|
35
|
-
|
|
36
25
|
function _lodash() {
|
|
37
26
|
const data = require("lodash");
|
|
38
|
-
|
|
39
27
|
_lodash = function () {
|
|
40
28
|
return data;
|
|
41
29
|
};
|
|
42
|
-
|
|
43
30
|
return data;
|
|
44
31
|
}
|
|
45
|
-
|
|
46
32
|
function _resolvePeer() {
|
|
47
33
|
const data = require("./resolve-peer");
|
|
48
|
-
|
|
49
34
|
_resolvePeer = function () {
|
|
50
35
|
return data;
|
|
51
36
|
};
|
|
52
|
-
|
|
53
37
|
return data;
|
|
54
38
|
}
|
|
55
|
-
|
|
56
39
|
function getExposedRules(peers, logger, hostRootDir) {
|
|
57
40
|
const loaderPath = require.resolve('expose-loader');
|
|
58
|
-
|
|
59
41
|
const depsEntries = peers.map(peer => {
|
|
60
42
|
const resolvedPath = (0, _resolvePeer().resolvePeerToFile)(peer, logger, hostRootDir);
|
|
61
43
|
if (!resolvedPath) return undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["getExposedRules","peers","logger","hostRootDir","loaderPath","require","resolve","depsEntries","map","peer","resolvedPath","resolvePeerToFile","undefined","path","globalName","camelcase","replace","pascalCase","generateExposeLoaders","compact"],"sources":["get-exposed-rules.ts"],"sourcesContent":["import camelcase from 'camelcase';\nimport 'expose-loader';\nimport { Logger } from '@teambit/logger';\nimport { generateExposeLoaders } from '@teambit/webpack.modules.generate-expose-loaders';\nimport { compact } from 'lodash';\nimport { resolvePeerToFile } from './resolve-peer';\n\nexport function getExposedRules(peers: string[], logger: Logger, hostRootDir?: string) {\n const loaderPath = require.resolve('expose-loader');\n const depsEntries = peers.map((peer) => {\n const resolvedPath = resolvePeerToFile(peer, logger, hostRootDir);\n if (!resolvedPath) return undefined;\n return {\n path: resolvedPath,\n globalName: camelcase(peer.replace('@', '').replace('/', '-'), { pascalCase: true }),\n };\n });\n return generateExposeLoaders(compact(depsEntries), { loaderPath });\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"names":["getExposedRules","peers","logger","hostRootDir","loaderPath","require","resolve","depsEntries","map","peer","resolvedPath","resolvePeerToFile","undefined","path","globalName","camelcase","replace","pascalCase","generateExposeLoaders","compact"],"sources":["get-exposed-rules.ts"],"sourcesContent":["import camelcase from 'camelcase';\nimport 'expose-loader';\nimport { Logger } from '@teambit/logger';\nimport { generateExposeLoaders } from '@teambit/webpack.modules.generate-expose-loaders';\nimport { compact } from 'lodash';\nimport { resolvePeerToFile } from './resolve-peer';\n\nexport function getExposedRules(peers: string[], logger: Logger, hostRootDir?: string) {\n const loaderPath = require.resolve('expose-loader');\n const depsEntries = peers.map((peer) => {\n const resolvedPath = resolvePeerToFile(peer, logger, hostRootDir);\n if (!resolvedPath) return undefined;\n return {\n path: resolvedPath,\n globalName: camelcase(peer.replace('@', '').replace('/', '-'), { pascalCase: true }),\n };\n });\n return generateExposeLoaders(compact(depsEntries), { loaderPath });\n}\n"],"mappings":";;;;;;;;;AAAA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;AAEA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAEO,SAASA,eAAe,CAACC,KAAe,EAAEC,MAAc,EAAEC,WAAoB,EAAE;EACrF,MAAMC,UAAU,GAAGC,OAAO,CAACC,OAAO,CAAC,eAAe,CAAC;EACnD,MAAMC,WAAW,GAAGN,KAAK,CAACO,GAAG,CAAEC,IAAI,IAAK;IACtC,MAAMC,YAAY,GAAG,IAAAC,gCAAiB,EAACF,IAAI,EAAEP,MAAM,EAAEC,WAAW,CAAC;IACjE,IAAI,CAACO,YAAY,EAAE,OAAOE,SAAS;IACnC,OAAO;MACLC,IAAI,EAAEH,YAAY;MAClBI,UAAU,EAAE,IAAAC,oBAAS,EAACN,IAAI,CAACO,OAAO,CAAC,GAAG,EAAE,EAAE,CAAC,CAACA,OAAO,CAAC,GAAG,EAAE,GAAG,CAAC,EAAE;QAAEC,UAAU,EAAE;MAAK,CAAC;IACrF,CAAC;EACH,CAAC,CAAC;EACF,OAAO,IAAAC,uCAAqB,EAAC,IAAAC,iBAAO,EAACZ,WAAW,CAAC,EAAE;IAAEH;EAAW,CAAC,CAAC;AACpE"}
|
|
@@ -1,36 +1,26 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
4
|
require("core-js/modules/es.regexp.exec.js");
|
|
6
|
-
|
|
7
5
|
require("core-js/modules/es.string.replace.js");
|
|
8
|
-
|
|
9
6
|
Object.defineProperty(exports, "__esModule", {
|
|
10
7
|
value: true
|
|
11
8
|
});
|
|
12
9
|
exports.getExternals = getExternals;
|
|
13
|
-
|
|
14
10
|
function _camelcase() {
|
|
15
11
|
const data = _interopRequireDefault(require("camelcase"));
|
|
16
|
-
|
|
17
12
|
_camelcase = function () {
|
|
18
13
|
return data;
|
|
19
14
|
};
|
|
20
|
-
|
|
21
15
|
return data;
|
|
22
16
|
}
|
|
23
|
-
|
|
24
17
|
function _webpackModules() {
|
|
25
18
|
const data = require("@teambit/webpack.modules.generate-externals");
|
|
26
|
-
|
|
27
19
|
_webpackModules = function () {
|
|
28
20
|
return data;
|
|
29
21
|
};
|
|
30
|
-
|
|
31
22
|
return data;
|
|
32
23
|
}
|
|
33
|
-
|
|
34
24
|
function getExternals(deps) {
|
|
35
25
|
return (0, _webpackModules().generateExternals)(deps, {
|
|
36
26
|
transformName: depName => (0, _camelcase().default)(depName.replace('@', '').replace('/', '-'), {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["getExternals","deps","generateExternals","transformName","depName","camelcase","replace","pascalCase"],"sources":["get-externals.ts"],"sourcesContent":["import camelcase from 'camelcase';\nimport { generateExternals } from '@teambit/webpack.modules.generate-externals';\n\nexport function getExternals(deps: string[]) {\n return generateExternals(deps, {\n transformName: (depName) => camelcase(depName.replace('@', '').replace('/', '-'), { pascalCase: true }),\n });\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"names":["getExternals","deps","generateExternals","transformName","depName","camelcase","replace","pascalCase"],"sources":["get-externals.ts"],"sourcesContent":["import camelcase from 'camelcase';\nimport { generateExternals } from '@teambit/webpack.modules.generate-externals';\n\nexport function getExternals(deps: string[]) {\n return generateExternals(deps, {\n transformName: (depName) => camelcase(depName.replace('@', '').replace('/', '-'), { pascalCase: true }),\n });\n}\n"],"mappings":";;;;;;;;;AAAA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAEO,SAASA,YAAY,CAACC,IAAc,EAAE;EAC3C,OAAO,IAAAC,mCAAiB,EAACD,IAAI,EAAE;IAC7BE,aAAa,EAAGC,OAAO,IAAK,IAAAC,oBAAS,EAACD,OAAO,CAACE,OAAO,CAAC,GAAG,EAAE,EAAE,CAAC,CAACA,OAAO,CAAC,GAAG,EAAE,GAAG,CAAC,EAAE;MAAEC,UAAU,EAAE;IAAK,CAAC;EACxG,CAAC,CAAC;AACJ"}
|
|
@@ -45,34 +45,25 @@ Object.defineProperty(exports, "generateExternalsTransformer", {
|
|
|
45
45
|
return _transformers().generateExternalsTransformer;
|
|
46
46
|
}
|
|
47
47
|
});
|
|
48
|
-
|
|
49
48
|
function _injectBody() {
|
|
50
49
|
const data = require("./inject-body");
|
|
51
|
-
|
|
52
50
|
_injectBody = function () {
|
|
53
51
|
return data;
|
|
54
52
|
};
|
|
55
|
-
|
|
56
53
|
return data;
|
|
57
54
|
}
|
|
58
|
-
|
|
59
55
|
function _injectHead() {
|
|
60
56
|
const data = require("./inject-head");
|
|
61
|
-
|
|
62
57
|
_injectHead = function () {
|
|
63
58
|
return data;
|
|
64
59
|
};
|
|
65
|
-
|
|
66
60
|
return data;
|
|
67
61
|
}
|
|
68
|
-
|
|
69
62
|
function _transformers() {
|
|
70
63
|
const data = require("./transformers");
|
|
71
|
-
|
|
72
64
|
_transformers = function () {
|
|
73
65
|
return data;
|
|
74
66
|
};
|
|
75
|
-
|
|
76
67
|
return data;
|
|
77
68
|
}
|
|
78
69
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["index.ts"],"sourcesContent":["export { GenerateBodyInjectionTransformer, BodyInjectionOptions } from './inject-body';\nexport { GenerateHeadInjectionTransformer, HeadInjectionOptions } from './inject-head';\nexport {\n generateAddAliasesFromPeersTransformer,\n generateExposePeersTransformer,\n generateExternalsTransformer,\n} from './transformers';\n"],"mappings":"
|
|
1
|
+
{"version":3,"names":[],"sources":["index.ts"],"sourcesContent":["export { GenerateBodyInjectionTransformer, BodyInjectionOptions } from './inject-body';\nexport { GenerateHeadInjectionTransformer, HeadInjectionOptions } from './inject-head';\nexport {\n generateAddAliasesFromPeersTransformer,\n generateExposePeersTransformer,\n generateExternalsTransformer,\n} from './transformers';\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA"}
|
|
@@ -1,22 +1,17 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
4
|
Object.defineProperty(exports, "__esModule", {
|
|
6
5
|
value: true
|
|
7
6
|
});
|
|
8
7
|
exports.GenerateBodyInjectionTransformer = GenerateBodyInjectionTransformer;
|
|
9
|
-
|
|
10
8
|
function _injectBodyWebpackPlugin() {
|
|
11
9
|
const data = _interopRequireDefault(require("inject-body-webpack-plugin"));
|
|
12
|
-
|
|
13
10
|
_injectBodyWebpackPlugin = function () {
|
|
14
11
|
return data;
|
|
15
12
|
};
|
|
16
|
-
|
|
17
13
|
return data;
|
|
18
14
|
}
|
|
19
|
-
|
|
20
15
|
/**
|
|
21
16
|
* A transformer that allow you to inject content into your html body
|
|
22
17
|
* We expose it from here, as it uses the inject-body-webpack-plugin which register to the html plugin hooks
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["GenerateBodyInjectionTransformer","options","config","plugin","InjectBodyPlugin","addPlugin"],"sources":["inject-body.ts"],"sourcesContent":["import InjectBodyPlugin from 'inject-body-webpack-plugin';\nimport type { WebpackConfigTransformer } from '@teambit/webpack';\n\nexport type BodyInjectionOptions = {\n content: string;\n position?: 'start' | 'end';\n};\n\n/**\n * A transformer that allow you to inject content into your html body\n * We expose it from here, as it uses the inject-body-webpack-plugin which register to the html plugin hooks\n * which means it depends on the fact that it has the same html plugin instance\n * since, the html plugin is configured via the webpack aspect, expose it from here ensure the same instance\n * @param options\n * @returns\n */\nexport function GenerateBodyInjectionTransformer(options: BodyInjectionOptions): WebpackConfigTransformer {\n return (config) => {\n // @ts-ignore - https://github.com/Jaid/inject-body-webpack-plugin/issues/12\n const plugin = new InjectBodyPlugin(options);\n\n return config.addPlugin(plugin);\n };\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"names":["GenerateBodyInjectionTransformer","options","config","plugin","InjectBodyPlugin","addPlugin"],"sources":["inject-body.ts"],"sourcesContent":["import InjectBodyPlugin from 'inject-body-webpack-plugin';\nimport type { WebpackConfigTransformer } from '@teambit/webpack';\n\nexport type BodyInjectionOptions = {\n content: string;\n position?: 'start' | 'end';\n};\n\n/**\n * A transformer that allow you to inject content into your html body\n * We expose it from here, as it uses the inject-body-webpack-plugin which register to the html plugin hooks\n * which means it depends on the fact that it has the same html plugin instance\n * since, the html plugin is configured via the webpack aspect, expose it from here ensure the same instance\n * @param options\n * @returns\n */\nexport function GenerateBodyInjectionTransformer(options: BodyInjectionOptions): WebpackConfigTransformer {\n return (config) => {\n // @ts-ignore - https://github.com/Jaid/inject-body-webpack-plugin/issues/12\n const plugin = new InjectBodyPlugin(options);\n\n return config.addPlugin(plugin);\n };\n}\n"],"mappings":";;;;;;;AAAA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAQA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASA,gCAAgC,CAACC,OAA6B,EAA4B;EACxG,OAAQC,MAAM,IAAK;IACjB;IACA,MAAMC,MAAM,GAAG,KAAIC,kCAAgB,EAACH,OAAO,CAAC;IAE5C,OAAOC,MAAM,CAACG,SAAS,CAACF,MAAM,CAAC;EACjC,CAAC;AACH"}
|