@teambit/webpack 1.0.103 → 1.0.105
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/webpack.dev.config.js +2 -3
- package/dist/config/webpack.dev.config.js.map +1 -1
- package/dist/events/webpack-compilation-done-event.js +2 -2
- package/dist/events/webpack-compilation-done-event.js.map +1 -1
- package/dist/events/webpack-compilation-started-event.js +2 -2
- package/dist/events/webpack-compilation-started-event.js.map +1 -1
- package/dist/plugins/webpack-bit-reporter-plugin.js +2 -2
- package/dist/plugins/webpack-bit-reporter-plugin.js.map +1 -1
- package/dist/{preview-1703301327107.js → preview-1703474083789.js} +2 -2
- package/dist/webpack.dev-server.js +2 -2
- package/dist/webpack.dev-server.js.map +1 -1
- package/dist/webpack.main.runtime.js +2 -2
- package/dist/webpack.main.runtime.js.map +1 -1
- package/package.json +9 -9
@@ -106,8 +106,8 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
|
|
106
106
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
107
107
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
108
108
|
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
109
|
-
function _toPropertyKey(
|
110
|
-
function _toPrimitive(
|
109
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : String(i); }
|
110
|
+
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
111
111
|
const publicUrlOrPath = (0, _getPublicUrlOrPath().default)(true, '/', '/public');
|
112
112
|
function configFactory(devServerID, workspaceDir, entryFiles, publicRoot, publicPath, componentPathsRegExps, pubsub, title, favicon) {
|
113
113
|
const resolveWorkspacePath = relativePath => _path().default.resolve(workspaceDir, relativePath);
|
@@ -134,7 +134,6 @@ function configFactory(devServerID, workspaceDir, entryFiles, publicRoot, public
|
|
134
134
|
// Commented out to use the default (self) as according to tobias with webpack5 self is working with workers as well
|
135
135
|
// globalObject: 'this',
|
136
136
|
},
|
137
|
-
|
138
137
|
infrastructureLogging: {
|
139
138
|
level: 'error'
|
140
139
|
},
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["_path","data","_interopRequireDefault","require","_webpack","_htmlWebpackPlugin","_errorOverlayMiddleware","_evalSourceMapMiddleware","_noopServiceWorkerMiddleware","_redirectServedPathMiddleware","_getPublicUrlOrPath","_utils","_webpackFallbacks","_html","_webpackBitReporterPlugin","_webpackFallbacksProvidePluginConfig","_webpackFallbacksAliases","obj","__esModule","default","ownKeys","e","r","t","Object","keys","getOwnPropertySymbols","o","filter","getOwnPropertyDescriptor","enumerable","push","apply","_objectSpread","arguments","length","forEach","_defineProperty","getOwnPropertyDescriptors","defineProperties","defineProperty","key","value","_toPropertyKey","configurable","writable","arg","_toPrimitive","String","input","hint","prim","Symbol","toPrimitive","undefined","res","call","TypeError","Number","publicUrlOrPath","getPublicUrlOrPath","configFactory","devServerID","workspaceDir","entryFiles","publicRoot","publicPath","componentPathsRegExps","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","logging","devServer","allowedHosts","static","directory","staticOptions","serveIndex","watch","compress","hot","historyApiFallback","disableDotRule","index","client","overlay","setupMiddlewares","middlewares","Error","evalSourceMapMiddleware","errorOverlayMiddleware","redirectServedPath","noopServiceWorkerMiddleware","devMiddleware","join","alias","fallbacksAliases","fallback","fallbacks","plugins","HtmlWebpackPlugin","templateContent","html","webpack","ProvidePlugin","fallbacksProvidePluginConfig","WebpackBitReporterPlugin","options","snapshot","managedPaths","watchOptions","poll"],"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(true, '/', '/public');\n\nexport function configFactory(\n devServerID: string,\n workspaceDir: string,\n entryFiles: string[],\n publicRoot: string,\n publicPath: string,\n componentPathsRegExps: RegExp[],\n pubsub: PubsubMain,\n title?: string,\n favicon?: string\n): WebpackConfigWithDevServer {\n const resolveWorkspacePath = (relativePath) => path.resolve(workspaceDir, relativePath);\n\n const publicDirectory = `${publicRoot}/${publicPath}`;\n\n return {\n // Environment mode\n mode: 'development',\n\n devtool: 'eval-cheap-module-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 logging: 'error',\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 logging: 'error',\n },\n\n setupMiddlewares: (middlewares, devServer) => {\n if (!devServer) {\n throw new Error('webpack-dev-server is not defined');\n }\n\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 middlewares.push(\n // @ts-ignore @types/wds mismatch\n evalSourceMapMiddleware(devServer),\n // This lets us open files from the runtime error overlay.\n errorOverlayMiddleware(),\n // Redirect to `PUBLIC_URL` or `homepage` from `package.json` if url not match\n redirectServedPath(publicUrlOrPath),\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 noopServiceWorkerMiddleware(publicUrlOrPath)\n );\n return middlewares;\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 snapshot: {\n ...(componentPathsRegExps && componentPathsRegExps.length > 0 ? { managedPaths: componentPathsRegExps } : {}),\n },\n\n watchOptions: {\n poll: true,\n },\n };\n}\n"],"mappings":";;;;;;AAAA,SAAAA,MAAA;EAAA,MAAAC,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAH,KAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAG,SAAA;EAAA,MAAAH,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAC,QAAA,YAAAA,CAAA;IAAA,OAAAH,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAI,mBAAA;EAAA,MAAAJ,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAE,kBAAA,YAAAA,CAAA;IAAA,OAAAJ,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAK,wBAAA;EAAA,M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;UACd,MAAM,IAAIgB,KAAK,CAAC,mCAAmC,CAAC;QACtD;;QAEA;QACA;QACA;QACAD,WAAW,CAAC9E,IAAI;QACd;QACA,IAAAgF,kCAAuB,EAACjB,SAAS,CAAC;QAClC;QACA,IAAAkB,iCAAsB,EAAC,CAAC;QACxB;QACA,IAAAC,uCAAkB,EAACtD,eAAe,CAAC;QACnC;QACA;QACA;QACA;QACA;QACA,IAAAuD,sCAA2B,EAACvD,eAAe,CAC7C,CAAC;QACD,OAAOkD,WAAW;MACpB,CAAC;MAEDM,aAAa,EAAE;QACb;QACAjD,UAAU,EAAEO,eAAI,CAAC2C,IAAI,CAAC,GAAG,EAAEnD,UAAU;MACvC;IACF,CAAC;IAEDS,OAAO,EAAE;MACP;MACA2C,KAAK,EAAEC,2CAAgB;MAEvBC,QAAQ,EAAEC;IACZ,CAAC;IAEDC,OAAO,EAAE,CACP,KAAIC,4BAAiB,EAAC;MACpBC,eAAe,EAAE,IAAAC,YAAI,EAACvD,KAAK,IAAI,mBAAmB,CAAC;MACnDa,QAAQ,EAAE,YAAY;MACtBZ;IACF,CAAC,CAAC,EACF,KAAIuD,kBAAO,CAACC,aAAa,EAACC,mEAA4B,CAAC,EAEvD,KAAIC,oDAAwB,EAAC;MAC3BC,OAAO,EAAE;QAAE7D,MAAM;QAAEN;MAAY;IACjC,CAAC,CAAC,CACH;IAEDoE,QAAQ,EAAAjG,aAAA,KACFkC,qBAAqB,IAAIA,qBAAqB,CAAChC,MAAM,GAAG,CAAC,GAAG;MAAEgG,YAAY,EAAEhE;IAAsB,CAAC,GAAG,CAAC,CAAC,CAC7G;IAEDiE,YAAY,EAAE;MACZC,IAAI,EAAE;IACR;EACF,CAAC;AACH"}
|
1
|
+
{"version":3,"names":["_path","data","_interopRequireDefault","require","_webpack","_htmlWebpackPlugin","_errorOverlayMiddleware","_evalSourceMapMiddleware","_noopServiceWorkerMiddleware","_redirectServedPathMiddleware","_getPublicUrlOrPath","_utils","_webpackFallbacks","_html","_webpackBitReporterPlugin","_webpackFallbacksProvidePluginConfig","_webpackFallbacksAliases","obj","__esModule","default","ownKeys","e","r","t","Object","keys","getOwnPropertySymbols","o","filter","getOwnPropertyDescriptor","enumerable","push","apply","_objectSpread","arguments","length","forEach","_defineProperty","getOwnPropertyDescriptors","defineProperties","defineProperty","key","value","_toPropertyKey","configurable","writable","i","_toPrimitive","String","Symbol","toPrimitive","call","TypeError","Number","publicUrlOrPath","getPublicUrlOrPath","configFactory","devServerID","workspaceDir","entryFiles","publicRoot","publicPath","componentPathsRegExps","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","logging","devServer","allowedHosts","static","directory","staticOptions","serveIndex","watch","compress","hot","historyApiFallback","disableDotRule","index","client","overlay","setupMiddlewares","middlewares","Error","evalSourceMapMiddleware","errorOverlayMiddleware","redirectServedPath","noopServiceWorkerMiddleware","devMiddleware","join","alias","fallbacksAliases","fallback","fallbacks","plugins","HtmlWebpackPlugin","templateContent","html","webpack","ProvidePlugin","fallbacksProvidePluginConfig","WebpackBitReporterPlugin","options","snapshot","managedPaths","watchOptions","poll"],"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(true, '/', '/public');\n\nexport function configFactory(\n devServerID: string,\n workspaceDir: string,\n entryFiles: string[],\n publicRoot: string,\n publicPath: string,\n componentPathsRegExps: RegExp[],\n pubsub: PubsubMain,\n title?: string,\n favicon?: string\n): WebpackConfigWithDevServer {\n const resolveWorkspacePath = (relativePath) => path.resolve(workspaceDir, relativePath);\n\n const publicDirectory = `${publicRoot}/${publicPath}`;\n\n return {\n // Environment mode\n mode: 'development',\n\n devtool: 'eval-cheap-module-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 logging: 'error',\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 logging: 'error',\n },\n\n setupMiddlewares: (middlewares, devServer) => {\n if (!devServer) {\n throw new Error('webpack-dev-server is not defined');\n }\n\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 middlewares.push(\n // @ts-ignore @types/wds mismatch\n evalSourceMapMiddleware(devServer),\n // This lets us open files from the runtime error overlay.\n errorOverlayMiddleware(),\n // Redirect to `PUBLIC_URL` or `homepage` from `package.json` if url not match\n redirectServedPath(publicUrlOrPath),\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 noopServiceWorkerMiddleware(publicUrlOrPath)\n );\n return middlewares;\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 snapshot: {\n ...(componentPathsRegExps && componentPathsRegExps.length > 0 ? { managedPaths: componentPathsRegExps } : {}),\n },\n\n watchOptions: {\n poll: true,\n },\n };\n}\n"],"mappings":";;;;;;AAAA,SAAAA,MAAA;EAAA,MAAAC,IAAA,GAAAC,sBAAA,CAAAC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AAC,CACH;IAEDoE,QAAQ,EAAA5F,aAAA,KACF6B,qBAAqB,IAAIA,qBAAqB,CAAC3B,MAAM,GAAG,CAAC,GAAG;MAAE2F,YAAY,EAAEhE;IAAsB,CAAC,GAAG,CAAC,CAAC,CAC7G;IAEDiE,YAAY,EAAE;MACZC,IAAI,EAAE;IACR;EACF,CAAC;AACH"}
|
@@ -12,8 +12,8 @@ function _pubsub() {
|
|
12
12
|
return data;
|
13
13
|
}
|
14
14
|
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
15
|
-
function _toPropertyKey(
|
16
|
-
function _toPrimitive(
|
15
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : String(i); }
|
16
|
+
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } /* eslint-disable max-classes-per-file */
|
17
17
|
class WebpackCompilationDoneEventData {
|
18
18
|
constructor(stats, devServerID) {
|
19
19
|
this.stats = stats;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["_pubsub","data","require","_defineProperty","obj","key","value","_toPropertyKey","Object","defineProperty","enumerable","configurable","writable","
|
1
|
+
{"version":3,"names":["_pubsub","data","require","_defineProperty","obj","key","value","_toPropertyKey","Object","defineProperty","enumerable","configurable","writable","t","i","_toPrimitive","String","r","e","Symbol","toPrimitive","call","TypeError","Number","WebpackCompilationDoneEventData","constructor","stats","devServerID","WebpackCompilationDoneEvent","BitBaseEvent","timestamp","TYPE","exports"],"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,SAAAA,QAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,OAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAA+C,SAAAE,gBAAAC,GAAA,EAAAC,GAAA,EAAAC,KAAA,IAAAD,GAAA,GAAAE,cAAA,CAAAF,GAAA,OAAAA,GAAA,IAAAD,GAAA,IAAAI,MAAA,CAAAC,cAAA,CAAAL,GAAA,EAAAC,GAAA,IAAAC,KAAA,EAAAA,KAAA,EAAAI,UAAA,QAAAC,YAAA,QAAAC,QAAA,oBAAAR,GAAA,CAAAC,GAAA,IAAAC,KAAA,WAAAF,GAAA;AAAA,SAAAG,eAAAM,CAAA,QAAAC,CAAA,GAAAC,YAAA,CAAAF,CAAA,uCAAAC,CAAA,GAAAA,CAAA,GAAAE,MAAA,CAAAF,CAAA;AAAA,SAAAC,aAAAF,CAAA,EAAAI,CAAA,2BAAAJ,CAAA,KAAAA,CAAA,SAAAA,CAAA,MAAAK,CAAA,GAAAL,CAAA,CAAAM,MAAA,CAAAC,WAAA,kBAAAF,CAAA,QAAAJ,CAAA,GAAAI,CAAA,CAAAG,IAAA,CAAAR,CAAA,EAAAI,CAAA,uCAAAH,CAAA,SAAAA,CAAA,YAAAQ,SAAA,yEAAAL,CAAA,GAAAD,MAAA,GAAAO,MAAA,EAAAV,CAAA,KAF/C;AAIA,MAAMW,+BAA+B,CAAC;EACpCC,WAAWA,CAAUC,KAAY,EAAWC,WAAmB,EAAE;IAAA,KAA5CD,KAAY,GAAZA,KAAY;IAAA,KAAWC,WAAmB,GAAnBA,WAAmB;EAAG;AACpE;AAEO,MAAMC,2BAA2B,SAASC,sBAAY,CAAkC;EAG7FJ,WAAWA,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,CACxD,CAAC;IAAC,KANiBG,SAAiB,GAAjBA,SAAiB;IAAA,KAAWJ,KAAY,GAAZA,KAAY;IAAA,KAAWC,WAAmB,GAAnBA,WAAmB;EAO3F;AACF;AAACK,OAAA,CAAAJ,2BAAA,GAAAA,2BAAA;AAAAzB,eAAA,CAXYyB,2BAA2B,UACf,0BAA0B"}
|
@@ -12,8 +12,8 @@ function _pubsub() {
|
|
12
12
|
return data;
|
13
13
|
}
|
14
14
|
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
15
|
-
function _toPropertyKey(
|
16
|
-
function _toPrimitive(
|
15
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : String(i); }
|
16
|
+
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } /* eslint-disable max-classes-per-file */
|
17
17
|
class WebpackCompilationStartedEvent extends _pubsub().BitBaseEvent {
|
18
18
|
constructor(timestamp, params) {
|
19
19
|
super(WebpackCompilationStartedEvent.TYPE, '0.0.1', timestamp, params);
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["_pubsub","data","require","_defineProperty","obj","key","value","_toPropertyKey","Object","defineProperty","enumerable","configurable","writable","
|
1
|
+
{"version":3,"names":["_pubsub","data","require","_defineProperty","obj","key","value","_toPropertyKey","Object","defineProperty","enumerable","configurable","writable","t","i","_toPrimitive","String","r","e","Symbol","toPrimitive","call","TypeError","Number","WebpackCompilationStartedEvent","BitBaseEvent","constructor","timestamp","params","TYPE","exports"],"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,SAAAA,QAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,OAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAA+C,SAAAE,gBAAAC,GAAA,EAAAC,GAAA,EAAAC,KAAA,IAAAD,GAAA,GAAAE,cAAA,CAAAF,GAAA,OAAAA,GAAA,IAAAD,GAAA,IAAAI,MAAA,CAAAC,cAAA,CAAAL,GAAA,EAAAC,GAAA,IAAAC,KAAA,EAAAA,KAAA,EAAAI,UAAA,QAAAC,YAAA,QAAAC,QAAA,oBAAAR,GAAA,CAAAC,GAAA,IAAAC,KAAA,WAAAF,GAAA;AAAA,SAAAG,eAAAM,CAAA,QAAAC,CAAA,GAAAC,YAAA,CAAAF,CAAA,uCAAAC,CAAA,GAAAA,CAAA,GAAAE,MAAA,CAAAF,CAAA;AAAA,SAAAC,aAAAF,CAAA,EAAAI,CAAA,2BAAAJ,CAAA,KAAAA,CAAA,SAAAA,CAAA,MAAAK,CAAA,GAAAL,CAAA,CAAAM,MAAA,CAAAC,WAAA,kBAAAF,CAAA,QAAAJ,CAAA,GAAAI,CAAA,CAAAG,IAAA,CAAAR,CAAA,EAAAI,CAAA,uCAAAH,CAAA,SAAAA,CAAA,YAAAQ,SAAA,yEAAAL,CAAA,GAAAD,MAAA,GAAAO,MAAA,EAAAV,CAAA,KAD/C;AAOO,MAAMW,8BAA8B,SAASC,sBAAY,CAAS;EAGvEC,WAAWA,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;AAACE,OAAA,CAAAN,8BAAA,GAAAA,8BAAA;AAAArB,eAAA,CANYqB,8BAA8B,UAClB,6BAA6B"}
|
@@ -19,8 +19,8 @@ function _webpack() {
|
|
19
19
|
return data;
|
20
20
|
}
|
21
21
|
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
22
|
-
function _toPropertyKey(
|
23
|
-
function _toPrimitive(
|
22
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : String(i); }
|
23
|
+
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
24
24
|
const PLUGIN_NAME = 'webpack-compiler-started-plugin';
|
25
25
|
|
26
26
|
/**
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["_events","data","require","_webpack","_defineProperty","obj","key","value","_toPropertyKey","Object","defineProperty","enumerable","configurable","writable","
|
1
|
+
{"version":3,"names":["_events","data","require","_webpack","_defineProperty","obj","key","value","_toPropertyKey","Object","defineProperty","enumerable","configurable","writable","t","i","_toPrimitive","String","r","e","Symbol","toPrimitive","call","TypeError","Number","PLUGIN_NAME","WebpackBitReporterPlugin","constructor","options","pubsub","devServerID","apply","compiler","hooks","compile","tap","event","WebpackCompilationStartedEvent","Date","now","pub","WebpackAspect","id","done","stats","WebpackCompilationDoneEvent","exports"],"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 | any) {\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,SAAAA,QAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,OAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAE,SAAA;EAAA,MAAAF,IAAA,GAAAC,OAAA;EAAAC,QAAA,YAAAA,CAAA;IAAA,OAAAF,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAAkD,SAAAG,gBAAAC,GAAA,EAAAC,GAAA,EAAAC,KAAA,IAAAD,GAAA,GAAAE,cAAA,CAAAF,GAAA,OAAAA,GAAA,IAAAD,GAAA,IAAAI,MAAA,CAAAC,cAAA,CAAA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AI,CAACR,GAAG,CAACV,WAAW,EAAGmB,KAAY,IAAK;MACrD,MAAMR,KAAK,GAAG,KAAIS,qCAA2B,EAACP,IAAI,CAACC,GAAG,CAAC,CAAC,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;AAACU,OAAA,CAAApB,wBAAA,GAAAA,wBAAA"}
|
@@ -1,5 +1,5 @@
|
|
1
|
-
import * as compositions_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.webpack_webpack@1.0.
|
2
|
-
import * as overview_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.webpack_webpack@1.0.
|
1
|
+
import * as compositions_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.webpack_webpack@1.0.105/dist/webpack.composition.js';
|
2
|
+
import * as overview_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.webpack_webpack@1.0.105/dist/webpack.docs.mdx';
|
3
3
|
|
4
4
|
export const compositions = [compositions_0];
|
5
5
|
export const overview = [overview_0];
|
@@ -34,8 +34,8 @@ function _webpack() {
|
|
34
34
|
}
|
35
35
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
36
36
|
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
37
|
-
function _toPropertyKey(
|
38
|
-
function _toPrimitive(
|
37
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : String(i); }
|
38
|
+
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
39
39
|
class WebpackDevServer {
|
40
40
|
constructor(config, webpack,
|
41
41
|
/**
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["_path","data","require","_findRoot","_interopRequireDefault","_util","_webpack","obj","__esModule","default","_defineProperty","key","value","_toPropertyKey","Object","defineProperty","enumerable","configurable","writable","
|
1
|
+
{"version":3,"names":["_path","data","require","_findRoot","_interopRequireDefault","_util","_webpack","obj","__esModule","default","_defineProperty","key","value","_toPropertyKey","Object","defineProperty","enumerable","configurable","writable","t","i","_toPrimitive","String","r","e","Symbol","toPrimitive","call","TypeError","Number","WebpackDevServer","constructor","config","webpack","webpackDevServer","WebpackAspect","id","WsDevServer","getCompiler","version","root","findRoot","packageJsonPath","join","packageJson","err","displayConfig","inspect","depth","listen","port","devServer","Error","addSignalListener","addDevServerEntrypoints","webpackDs","start","server","process","on","exit","exports"],"sources":["webpack.dev-server.ts"],"sourcesContent":["import { join } from 'path';\nimport type { DevServer } from '@teambit/bundler';\nimport findRoot from 'find-root';\nimport type { Server } from 'http';\nimport type { webpack as webpackCompiler, Configuration } from 'webpack';\nimport type * as WDS from 'webpack-dev-server';\nimport { inspect } from 'util';\nimport { WebpackAspect } from './webpack.aspect';\n\nexport interface WebpackConfigWithDevServer extends Configuration {\n devServer: WDS.Configuration;\n favicon?: string;\n}\nexport class WebpackDevServer implements DevServer {\n private readonly WsDevServer: typeof WDS;\n constructor(\n private config: WebpackConfigWithDevServer,\n private webpack: typeof webpackCompiler,\n /**\n * path to the webpack-dev-server module or instance of webpack-dev-server.\n * this accept getting an instance for backward compatibility.\n */\n private webpackDevServer: string | typeof WDS\n ) {\n if (typeof this.webpackDevServer === 'string') {\n // eslint-disable-next-line import/no-dynamic-require, global-require\n this.WsDevServer = require(this.webpackDevServer);\n } else {\n this.WsDevServer = this.webpackDevServer;\n }\n }\n\n private getCompiler(): any {\n return this.webpack(this.config);\n }\n\n id = WebpackAspect.id;\n\n displayName = 'Webpack dev server';\n\n version(): string {\n if (typeof this.webpackDevServer !== 'string') {\n return 'unknown';\n }\n // Resolve version from the webpack-dev-server package.json\n try {\n const root = findRoot(this.webpackDevServer);\n const packageJsonPath = join(root, 'package.json');\n // eslint-disable-next-line import/no-dynamic-require, global-require\n const packageJson = require(packageJsonPath);\n return packageJson.version;\n } catch (err) {\n return 'unknown';\n }\n }\n\n displayConfig(): string {\n return inspect(this.config, { depth: 10 });\n }\n\n async listen(port: number): Promise<Server> {\n if (!this.config.devServer) {\n throw new Error('Missing devServer configuration for webpack');\n }\n // Prevent different port between the config port and the listen arg port\n this.config.devServer.port = port;\n\n // Adding signal listeners to make sure we immediately close the process on sigint / sigterm (otherwise webpack dev server closing will take time)\n this.addSignalListener();\n\n // Compatibility check for Webpack dev server v3 (e.g. for Angular v8)\n if (typeof (this.WsDevServer as any).addDevServerEntrypoints !== 'undefined') {\n // @ts-ignore in the capsules it throws an error about compatibilities issues between webpack.compiler and webpackDevServer/webpack/compiler\n const webpackDs = new (this.WsDevServer as any)(this.getCompiler(), this.config.devServer);\n return webpackDs.listen(port);\n }\n\n // @ts-ignore in the capsules it throws an error about compatibilities issues between webpack.compiler and webpackDevServer/webpack/compiler\n const webpackDs: WDS = new this.WsDevServer(this.config.devServer, this.getCompiler());\n await webpackDs.start();\n\n // @ts-ignore\n return webpackDs.server;\n }\n\n private addSignalListener() {\n process.on('SIGTERM', () => {\n process.exit();\n });\n\n process.on('SIGINT', () => {\n process.exit();\n });\n }\n}\n"],"mappings":";;;;;;AAAA,SAAAA,MAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,KAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,SAAAE,UAAA;EAAA,MAAAF,IAAA,GAAAG,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AAE;MAC1B,MAAM,IAAIC,KAAK,CAAC,6CAA6C,CAAC;IAChE;IACA;IACA,IAAI,CAACpB,MAAM,CAACmB,SAAS,CAACD,IAAI,GAAGA,IAAI;;IAEjC;IACA,IAAI,CAACG,iBAAiB,CAAC,CAAC;;IAExB;IACA,IAAI,OAAQ,IAAI,CAAChB,WAAW,CAASiB,uBAAuB,KAAK,WAAW,EAAE;MAC5E;MACA,MAAMC,SAAS,GAAG,IAAK,IAAI,CAAClB,WAAW,CAAS,IAAI,CAACC,WAAW,CAAC,CAAC,EAAE,IAAI,CAACN,MAAM,CAACmB,SAAS,CAAC;MAC1F,OAAOI,SAAS,CAACN,MAAM,CAACC,IAAI,CAAC;IAC/B;;IAEA;IACA,MAAMK,SAAc,GAAG,IAAI,IAAI,CAAClB,WAAW,CAAC,IAAI,CAACL,MAAM,CAACmB,SAAS,EAAE,IAAI,CAACb,WAAW,CAAC,CAAC,CAAC;IACtF,MAAMiB,SAAS,CAACC,KAAK,CAAC,CAAC;;IAEvB;IACA,OAAOD,SAAS,CAACE,MAAM;EACzB;EAEQJ,iBAAiBA,CAAA,EAAG;IAC1BK,OAAO,CAACC,EAAE,CAAC,SAAS,EAAE,MAAM;MAC1BD,OAAO,CAACE,IAAI,CAAC,CAAC;IAChB,CAAC,CAAC;IAEFF,OAAO,CAACC,EAAE,CAAC,QAAQ,EAAE,MAAM;MACzBD,OAAO,CAACE,IAAI,CAAC,CAAC;IAChB,CAAC,CAAC;EACJ;AACF;AAACC,OAAA,CAAA/B,gBAAA,GAAAA,gBAAA"}
|
@@ -105,8 +105,8 @@ function _webpack5() {
|
|
105
105
|
}
|
106
106
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
107
107
|
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
108
|
-
function _toPropertyKey(
|
109
|
-
function _toPrimitive(
|
108
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : String(i); }
|
109
|
+
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } // We want to import it to make sure bit recognizes it as a dependency
|
110
110
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
111
111
|
class WebpackMain {
|
112
112
|
constructor(
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["_webpack","data","_interopRequireDefault","require","_pubsub","_bundler","_cli","_logger","_workspace","_webpackMerge","_webpackModules","_transformers","_webpackDev","_webpack2","_webpack3","_webpack4","_webpack5","obj","__esModule","default","_defineProperty","key","value","_toPropertyKey","Object","defineProperty","enumerable","configurable","writable","arg","_toPrimitive","String","input","hint","prim","Symbol","toPrimitive","undefined","res","call","TypeError","Number","WebpackMain","constructor","pubsub","workspace","bundler","logger","createDevServer","context","transformers","webpackModulePath","webpackDevServerModulePath","config","createDevServerConfig","entry","path","id","rootPath","publicPath","getComponentPathsRegExps","title","wdsPath","resolve","configMutator","WebpackConfigMutator","transformerContext","assign","mode","internalTransformers","generateTransformers","afterMutation","runTransformersWithContext","clone","WebpackDevServer","raw","getWebpackInstance","webpack","mergeConfig","target","source","merge","createBundler","initialConfigs","webpackModuleOrPath","_context$metaData","isEnvTemplate","metaData","configs","createConfigs","targets","baseConfigFactory","WebpackBundler","factory","bundlerContext","map","baseConfig","_bundlerContext","devServerContext","hostDeps","hostDependencies","aliasHostDependencies","peerAliasesTransformer","generateAddAliasesFromPeersTransformer","push","externalizeHostDependencies","externalsTransformer","generateExternalsTransformer","webpackOrPath","fallback","devServerID","publicRoot","componentPathsRegExps","devServerConfigFactory","provider","logPublisher","createLogger","WebpackAspect","exports","MainRuntime","PubsubAspect","WorkspaceAspect","BundlerAspect","LoggerAspect","addRuntime","Array","isArray","newConfig","reduce","acc","transformer"],"sources":["webpack.main.runtime.ts"],"sourcesContent":["import webpack, { Configuration } from 'webpack';\nimport PubsubAspect, { PubsubMain } from '@teambit/pubsub';\nimport {\n BundlerAspect,\n BundlerContext,\n BundlerMain,\n DevServer,\n DevServerContext,\n BundlerMode,\n Target,\n} from '@teambit/bundler';\nimport { MainRuntime } from '@teambit/cli';\nimport { Logger, LoggerAspect, LoggerMain } from '@teambit/logger';\nimport { Workspace, WorkspaceAspect } from '@teambit/workspace';\nimport { merge } from 'webpack-merge';\n// We want to import it to make sure bit recognizes it as a dependency\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nimport WsDevServer from 'webpack-dev-server';\nimport { WebpackConfigMutator } from '@teambit/webpack.modules.config-mutator';\n\nimport { generateAddAliasesFromPeersTransformer, generateExternalsTransformer } from './transformers';\nimport { configFactory as devServerConfigFactory } from './config/webpack.dev.config';\nimport { configFactory as baseConfigFactory } from './config/webpack.config';\n\nimport { WebpackAspect } from './webpack.aspect';\nimport { WebpackBundler } from './webpack.bundler';\nimport { WebpackDevServer } from './webpack.dev-server';\n\nexport type WebpackConfigTransformContext = GlobalWebpackConfigTransformContext & {\n target: Target;\n};\n\nexport type WebpackConfigDevServerTransformContext = GlobalWebpackConfigTransformContext & DevServerContext;\n\nexport type GlobalWebpackConfigTransformContext = {\n mode: BundlerMode;\n /**\n * Whether the config is for an env template bundling\n */\n isEnvTemplate?: boolean;\n /**\n * A path for the host root dir\n * Host root dir is usually the env root dir\n * This can be used in different bundle options which run require.resolve\n * for example when configuring webpack aliases or webpack expose loader on the peers deps\n */\n hostRootDir?: string;\n};\n\nexport type WebpackConfigTransformer = (\n config: WebpackConfigMutator,\n context: WebpackConfigTransformContext\n) => WebpackConfigMutator;\n\nexport type WebpackConfigDevServerTransformer = (\n config: WebpackConfigMutator,\n context: WebpackConfigDevServerTransformContext\n) => WebpackConfigMutator;\n\nexport class WebpackMain {\n constructor(\n /**\n * Pubsub extension.\n */\n public pubsub: PubsubMain,\n\n /**\n * workspace extension.\n */\n private workspace: Workspace,\n\n /**\n * bundler extension.\n */\n private bundler: BundlerMain,\n\n /**\n * Logger extension\n */\n public logger: Logger\n ) {}\n\n /**\n * create an instance of bit-compliant webpack dev server for a set of components\n */\n createDevServer(\n context: DevServerContext,\n transformers: WebpackConfigTransformer[] = [],\n webpackModulePath?: string,\n webpackDevServerModulePath?: string\n ): DevServer {\n const config = this.createDevServerConfig(\n context.entry,\n this.workspace.path,\n context.id,\n context.rootPath,\n context.publicPath,\n this.workspace.getComponentPathsRegExps(),\n context.title\n ) as any;\n const wdsPath = webpackDevServerModulePath || require.resolve('webpack-dev-server');\n const configMutator = new WebpackConfigMutator(config);\n const transformerContext: WebpackConfigDevServerTransformContext = Object.assign(context, { mode: 'dev' as const });\n const internalTransformers = this.generateTransformers(undefined, transformerContext);\n\n const afterMutation = runTransformersWithContext(\n configMutator.clone(),\n [...internalTransformers, ...transformers],\n transformerContext\n );\n // @ts-ignore - fix this\n return new WebpackDevServer(afterMutation.raw, this.getWebpackInstance(webpackModulePath, webpack), wdsPath);\n }\n\n mergeConfig(target: any, source: any): any {\n return merge(target, source);\n }\n\n createBundler(\n context: BundlerContext,\n transformers: WebpackConfigTransformer[] = [],\n initialConfigs?: webpack.Configuration[],\n webpackModuleOrPath?: string | any\n ) {\n const transformerContext: GlobalWebpackConfigTransformContext = {\n mode: 'prod',\n isEnvTemplate: context.metaData?.isEnvTemplate,\n };\n // eslint-disable-next-line max-len\n const configs =\n initialConfigs ||\n this.createConfigs(context.targets, baseConfigFactory, transformers, transformerContext, context);\n return new WebpackBundler(\n context.targets,\n configs,\n this.logger,\n this.getWebpackInstance(webpackModuleOrPath, webpack),\n context.metaData\n );\n }\n\n private createConfigs(\n targets: Target[],\n factory: (target: Target, context: BundlerContext) => Configuration,\n transformers: WebpackConfigTransformer[] = [],\n transformerContext: GlobalWebpackConfigTransformContext,\n bundlerContext: BundlerContext\n ) {\n return targets.map((target) => {\n const baseConfig = factory(target, bundlerContext);\n const configMutator = new WebpackConfigMutator(baseConfig);\n const context = Object.assign({}, transformerContext, { target });\n const internalTransformers = this.generateTransformers(context, undefined, target);\n const afterMutation = runTransformersWithContext(\n configMutator.clone(),\n [...internalTransformers, ...transformers],\n context\n );\n return afterMutation.raw;\n });\n }\n\n private generateTransformers(\n _bundlerContext?: WebpackConfigTransformContext,\n devServerContext?: WebpackConfigDevServerTransformContext,\n target?: Target\n ): Array<WebpackConfigTransformer> {\n const transformers: WebpackConfigTransformer[] = [];\n // TODO: handle dev server\n const hostDeps = target?.hostDependencies || devServerContext?.hostDependencies;\n if (hostDeps) {\n if (target?.aliasHostDependencies || devServerContext?.aliasHostDependencies) {\n const peerAliasesTransformer = generateAddAliasesFromPeersTransformer(hostDeps, this.logger);\n transformers.push(peerAliasesTransformer);\n }\n if (target?.externalizeHostDependencies || devServerContext?.externalizeHostDependencies) {\n const externalsTransformer = generateExternalsTransformer(hostDeps);\n transformers.push(externalsTransformer);\n }\n }\n return transformers;\n }\n\n private getWebpackInstance(webpackOrPath?: any | string, fallback?: any) {\n if (!webpackOrPath) {\n return fallback;\n }\n if (typeof webpackOrPath === 'string') {\n // eslint-disable-next-line import/no-dynamic-require, global-require\n return require(webpackOrPath);\n }\n return webpackOrPath;\n }\n\n private createDevServerConfig(\n entry: string[],\n rootPath: string,\n devServerID: string,\n publicRoot: string,\n publicPath: string,\n componentPathsRegExps: RegExp[],\n title?: string\n ) {\n return devServerConfigFactory(\n devServerID,\n rootPath,\n entry,\n publicRoot,\n publicPath,\n componentPathsRegExps,\n this.pubsub,\n title\n );\n }\n\n static slots = [];\n\n static runtime = MainRuntime;\n static dependencies = [PubsubAspect, WorkspaceAspect, BundlerAspect, LoggerAspect];\n\n static async provider([pubsub, workspace, bundler, logger]: [PubsubMain, Workspace, BundlerMain, LoggerMain]) {\n const logPublisher = logger.createLogger(WebpackAspect.id);\n return new WebpackMain(pubsub, workspace, bundler, logPublisher);\n }\n}\n\nWebpackAspect.addRuntime(WebpackMain);\n\nexport function runTransformersWithContext(\n config: WebpackConfigMutator,\n transformers: Array<WebpackConfigTransformer | WebpackConfigDevServerTransformer> = [],\n // context: WebpackConfigTransformContext | WebpackConfigDevServerTransformContext\n context: any\n): WebpackConfigMutator {\n if (!Array.isArray(transformers)) return config;\n const newConfig = transformers.reduce((acc, transformer) => {\n // @ts-ignore\n return transformer(acc, context);\n }, config);\n return newConfig;\n}\n"],"mappings":";;;;;;;AAAA,SAAAA,SAAA;EAAA,MAAAC,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAH,QAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAG,QAAA;EAAA,MAAAH,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAC,OAAA,YAAAA,CAAA;IAAA,OAAAH,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAI,SAAA;EAAA,MAAAJ,IAAA,GAAAE,OAAA;EAAAE,QAAA,YAAAA,CAAA;IAAA,OAAAJ,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AASA,SAAAK,KAAA;EAAA,MAAAL,IAAA,GAAAE,OAAA;EAAAG,IAAA,YAAAA,CAAA;IAAA,OAAAL,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAM,QAAA;EAAA,MAAAN,IAAA,GAAAE,OAAA;EAAAI,OAAA,YAAAA,CAAA;IAAA,OAAAN,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAO,WAAA;EAAA,MAAAP,IAAA,GAAAE,OAAA;EAAAK,UAAA,YAAAA,CAAA;IAAA,OAAAP,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAQ,cAAA;EAAA,MAAAR,IAAA,GAAAE,OAAA;EAAAM,aAAA,YAAAA,CAAA;IAAA,OAAAR,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAI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AAA,CAAA5E,WAAA,GAAAA,WAAA;AAAAtB,eAAA,CArKYsB,WAAW,WA4JP,EAAE;AAAAtB,eAAA,CA5JNsB,WAAW,aA8JL6E,kBAAW;AAAAnG,eAAA,CA9JjBsB,WAAW,kBA+JA,CAAC8E,iBAAY,EAAEC,4BAAe,EAAEC,wBAAa,EAAEC,sBAAY,CAAC;AAQpFN,yBAAa,CAACO,UAAU,CAAClF,WAAW,CAAC;AAE9B,SAAS8B,0BAA0BA,CACxCnB,MAA4B,EAC5BH,YAAiF,GAAG,EAAE;AACtF;AACAD,OAAY,EACU;EACtB,IAAI,CAAC4E,KAAK,CAACC,OAAO,CAAC5E,YAAY,CAAC,EAAE,OAAOG,MAAM;EAC/C,MAAM0E,SAAS,GAAG7E,YAAY,CAAC8E,MAAM,CAAC,CAACC,GAAG,EAAEC,WAAW,KAAK;IAC1D;IACA,OAAOA,WAAW,CAACD,GAAG,EAAEhF,OAAO,CAAC;EAClC,CAAC,EAAEI,MAAM,CAAC;EACV,OAAO0E,SAAS;AAClB"}
|
1
|
+
{"version":3,"names":["_webpack","data","_interopRequireDefault","require","_pubsub","_bundler","_cli","_logger","_workspace","_webpackMerge","_webpackModules","_transformers","_webpackDev","_webpack2","_webpack3","_webpack4","_webpack5","obj","__esModule","default","_defineProperty","key","value","_toPropertyKey","Object","defineProperty","enumerable","configurable","writable","t","i","_toPrimitive","String","r","e","Symbol","toPrimitive","call","TypeError","Number","WebpackMain","constructor","pubsub","workspace","bundler","logger","createDevServer","context","transformers","webpackModulePath","webpackDevServerModulePath","config","createDevServerConfig","entry","path","id","rootPath","publicPath","getComponentPathsRegExps","title","wdsPath","resolve","configMutator","WebpackConfigMutator","transformerContext","assign","mode","internalTransformers","generateTransformers","undefined","afterMutation","runTransformersWithContext","clone","WebpackDevServer","raw","getWebpackInstance","webpack","mergeConfig","target","source","merge","createBundler","initialConfigs","webpackModuleOrPath","_context$metaData","isEnvTemplate","metaData","configs","createConfigs","targets","baseConfigFactory","WebpackBundler","factory","bundlerContext","map","baseConfig","_bundlerContext","devServerContext","hostDeps","hostDependencies","aliasHostDependencies","peerAliasesTransformer","generateAddAliasesFromPeersTransformer","push","externalizeHostDependencies","externalsTransformer","generateExternalsTransformer","webpackOrPath","fallback","devServerID","publicRoot","componentPathsRegExps","devServerConfigFactory","provider","logPublisher","createLogger","WebpackAspect","exports","MainRuntime","PubsubAspect","WorkspaceAspect","BundlerAspect","LoggerAspect","addRuntime","Array","isArray","newConfig","reduce","acc","transformer"],"sources":["webpack.main.runtime.ts"],"sourcesContent":["import webpack, { Configuration } from 'webpack';\nimport PubsubAspect, { PubsubMain } from '@teambit/pubsub';\nimport {\n BundlerAspect,\n BundlerContext,\n BundlerMain,\n DevServer,\n DevServerContext,\n BundlerMode,\n Target,\n} from '@teambit/bundler';\nimport { MainRuntime } from '@teambit/cli';\nimport { Logger, LoggerAspect, LoggerMain } from '@teambit/logger';\nimport { Workspace, WorkspaceAspect } from '@teambit/workspace';\nimport { merge } from 'webpack-merge';\n// We want to import it to make sure bit recognizes it as a dependency\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nimport WsDevServer from 'webpack-dev-server';\nimport { WebpackConfigMutator } from '@teambit/webpack.modules.config-mutator';\n\nimport { generateAddAliasesFromPeersTransformer, generateExternalsTransformer } from './transformers';\nimport { configFactory as devServerConfigFactory } from './config/webpack.dev.config';\nimport { configFactory as baseConfigFactory } from './config/webpack.config';\n\nimport { WebpackAspect } from './webpack.aspect';\nimport { WebpackBundler } from './webpack.bundler';\nimport { WebpackDevServer } from './webpack.dev-server';\n\nexport type WebpackConfigTransformContext = GlobalWebpackConfigTransformContext & {\n target: Target;\n};\n\nexport type WebpackConfigDevServerTransformContext = GlobalWebpackConfigTransformContext & DevServerContext;\n\nexport type GlobalWebpackConfigTransformContext = {\n mode: BundlerMode;\n /**\n * Whether the config is for an env template bundling\n */\n isEnvTemplate?: boolean;\n /**\n * A path for the host root dir\n * Host root dir is usually the env root dir\n * This can be used in different bundle options which run require.resolve\n * for example when configuring webpack aliases or webpack expose loader on the peers deps\n */\n hostRootDir?: string;\n};\n\nexport type WebpackConfigTransformer = (\n config: WebpackConfigMutator,\n context: WebpackConfigTransformContext\n) => WebpackConfigMutator;\n\nexport type WebpackConfigDevServerTransformer = (\n config: WebpackConfigMutator,\n context: WebpackConfigDevServerTransformContext\n) => WebpackConfigMutator;\n\nexport class WebpackMain {\n constructor(\n /**\n * Pubsub extension.\n */\n public pubsub: PubsubMain,\n\n /**\n * workspace extension.\n */\n private workspace: Workspace,\n\n /**\n * bundler extension.\n */\n private bundler: BundlerMain,\n\n /**\n * Logger extension\n */\n public logger: Logger\n ) {}\n\n /**\n * create an instance of bit-compliant webpack dev server for a set of components\n */\n createDevServer(\n context: DevServerContext,\n transformers: WebpackConfigTransformer[] = [],\n webpackModulePath?: string,\n webpackDevServerModulePath?: string\n ): DevServer {\n const config = this.createDevServerConfig(\n context.entry,\n this.workspace.path,\n context.id,\n context.rootPath,\n context.publicPath,\n this.workspace.getComponentPathsRegExps(),\n context.title\n ) as any;\n const wdsPath = webpackDevServerModulePath || require.resolve('webpack-dev-server');\n const configMutator = new WebpackConfigMutator(config);\n const transformerContext: WebpackConfigDevServerTransformContext = Object.assign(context, { mode: 'dev' as const });\n const internalTransformers = this.generateTransformers(undefined, transformerContext);\n\n const afterMutation = runTransformersWithContext(\n configMutator.clone(),\n [...internalTransformers, ...transformers],\n transformerContext\n );\n // @ts-ignore - fix this\n return new WebpackDevServer(afterMutation.raw, this.getWebpackInstance(webpackModulePath, webpack), wdsPath);\n }\n\n mergeConfig(target: any, source: any): any {\n return merge(target, source);\n }\n\n createBundler(\n context: BundlerContext,\n transformers: WebpackConfigTransformer[] = [],\n initialConfigs?: webpack.Configuration[],\n webpackModuleOrPath?: string | any\n ) {\n const transformerContext: GlobalWebpackConfigTransformContext = {\n mode: 'prod',\n isEnvTemplate: context.metaData?.isEnvTemplate,\n };\n // eslint-disable-next-line max-len\n const configs =\n initialConfigs ||\n this.createConfigs(context.targets, baseConfigFactory, transformers, transformerContext, context);\n return new WebpackBundler(\n context.targets,\n configs,\n this.logger,\n this.getWebpackInstance(webpackModuleOrPath, webpack),\n context.metaData\n );\n }\n\n private createConfigs(\n targets: Target[],\n factory: (target: Target, context: BundlerContext) => Configuration,\n transformers: WebpackConfigTransformer[] = [],\n transformerContext: GlobalWebpackConfigTransformContext,\n bundlerContext: BundlerContext\n ) {\n return targets.map((target) => {\n const baseConfig = factory(target, bundlerContext);\n const configMutator = new WebpackConfigMutator(baseConfig);\n const context = Object.assign({}, transformerContext, { target });\n const internalTransformers = this.generateTransformers(context, undefined, target);\n const afterMutation = runTransformersWithContext(\n configMutator.clone(),\n [...internalTransformers, ...transformers],\n context\n );\n return afterMutation.raw;\n });\n }\n\n private generateTransformers(\n _bundlerContext?: WebpackConfigTransformContext,\n devServerContext?: WebpackConfigDevServerTransformContext,\n target?: Target\n ): Array<WebpackConfigTransformer> {\n const transformers: WebpackConfigTransformer[] = [];\n // TODO: handle dev server\n const hostDeps = target?.hostDependencies || devServerContext?.hostDependencies;\n if (hostDeps) {\n if (target?.aliasHostDependencies || devServerContext?.aliasHostDependencies) {\n const peerAliasesTransformer = generateAddAliasesFromPeersTransformer(hostDeps, this.logger);\n transformers.push(peerAliasesTransformer);\n }\n if (target?.externalizeHostDependencies || devServerContext?.externalizeHostDependencies) {\n const externalsTransformer = generateExternalsTransformer(hostDeps);\n transformers.push(externalsTransformer);\n }\n }\n return transformers;\n }\n\n private getWebpackInstance(webpackOrPath?: any | string, fallback?: any) {\n if (!webpackOrPath) {\n return fallback;\n }\n if (typeof webpackOrPath === 'string') {\n // eslint-disable-next-line import/no-dynamic-require, global-require\n return require(webpackOrPath);\n }\n return webpackOrPath;\n }\n\n private createDevServerConfig(\n entry: string[],\n rootPath: string,\n devServerID: string,\n publicRoot: string,\n publicPath: string,\n componentPathsRegExps: RegExp[],\n title?: string\n ) {\n return devServerConfigFactory(\n devServerID,\n rootPath,\n entry,\n publicRoot,\n publicPath,\n componentPathsRegExps,\n this.pubsub,\n title\n );\n }\n\n static slots = [];\n\n static runtime = MainRuntime;\n static dependencies = [PubsubAspect, WorkspaceAspect, BundlerAspect, LoggerAspect];\n\n static async provider([pubsub, workspace, bundler, logger]: [PubsubMain, Workspace, BundlerMain, LoggerMain]) {\n const logPublisher = logger.createLogger(WebpackAspect.id);\n return new WebpackMain(pubsub, workspace, bundler, logPublisher);\n }\n}\n\nWebpackAspect.addRuntime(WebpackMain);\n\nexport function runTransformersWithContext(\n config: WebpackConfigMutator,\n transformers: Array<WebpackConfigTransformer | WebpackConfigDevServerTransformer> = [],\n // context: WebpackConfigTransformContext | WebpackConfigDevServerTransformContext\n context: any\n): WebpackConfigMutator {\n if (!Array.isArray(transformers)) return config;\n const newConfig = transformers.reduce((acc, transformer) => {\n // @ts-ignore\n return transformer(acc, context);\n }, config);\n return newConfig;\n}\n"],"mappings":";;;;;;;AAAA,SAAAA,SAAA;EAAA,MAAAC,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAH,QAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAG,QAAA;EAAA,MAAAH,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAC,OAAA,YAAAA,CAAA;IAAA,OAAAH,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAI,SAAA;EAAA,MAAAJ,IAAA,GAAAE,OAAA;EAAAE,QAAA,YAAAA,CAAA;IAAA,OAAAJ,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AASA,SAAAK,KAAA;EAAA,MAAAL,IAAA,GAAAE,OAAA;EAAAG,IAAA,YAAAA,CAAA;IAAA,OAAAL,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAM,QAAA;EAAA,MAAAN,IAAA,GAAAE,OAAA;EAAAI,OAAA,YAAAA,CAAA;IAAA,OAAAN,IAAA;EAAA;EAAA,OAAAA,IA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MAAM,EAAEC,SAAS,EAAEC,OAAO,EAAEC,MAAM,CAAmD,EAAE;IAC5G,MAAMqE,YAAY,GAAGrE,MAAM,CAACsE,YAAY,CAACC,yBAAa,CAAC7D,EAAE,CAAC;IAC1D,OAAO,IAAIf,WAAW,CAACE,MAAM,EAAEC,SAAS,EAAEC,OAAO,EAAEsE,YAAY,CAAC;EAClE;AACF;AAACG,OAAA,CAAA7E,WAAA,GAAAA,WAAA;AAAApB,eAAA,CArKYoB,WAAW,WA4JP,EAAE;AAAApB,eAAA,CA5JNoB,WAAW,aA8JL8E,kBAAW;AAAAlG,eAAA,CA9JjBoB,WAAW,kBA+JA,CAAC+E,iBAAY,EAAEC,4BAAe,EAAEC,wBAAa,EAAEC,sBAAY,CAAC;AAQpFN,yBAAa,CAACO,UAAU,CAACnF,WAAW,CAAC;AAE9B,SAAS+B,0BAA0BA,CACxCpB,MAA4B,EAC5BH,YAAiF,GAAG,EAAE;AACtF;AACAD,OAAY,EACU;EACtB,IAAI,CAAC6E,KAAK,CAACC,OAAO,CAAC7E,YAAY,CAAC,EAAE,OAAOG,MAAM;EAC/C,MAAM2E,SAAS,GAAG9E,YAAY,CAAC+E,MAAM,CAAC,CAACC,GAAG,EAAEC,WAAW,KAAK;IAC1D;IACA,OAAOA,WAAW,CAACD,GAAG,EAAEjF,OAAO,CAAC;EAClC,CAAC,EAAEI,MAAM,CAAC;EACV,OAAO2E,SAAS;AAClB"}
|
package/package.json
CHANGED
@@ -1,12 +1,12 @@
|
|
1
1
|
{
|
2
2
|
"name": "@teambit/webpack",
|
3
|
-
"version": "1.0.
|
3
|
+
"version": "1.0.105",
|
4
4
|
"homepage": "https://bit.cloud/teambit/webpack/webpack",
|
5
5
|
"main": "dist/index.js",
|
6
6
|
"componentId": {
|
7
7
|
"scope": "teambit.webpack",
|
8
8
|
"name": "webpack",
|
9
|
-
"version": "1.0.
|
9
|
+
"version": "1.0.105"
|
10
10
|
},
|
11
11
|
"dependencies": {
|
12
12
|
"webpack": "5.84.1",
|
@@ -48,14 +48,14 @@
|
|
48
48
|
"@teambit/harmony": "0.4.6",
|
49
49
|
"@teambit/bit-error": "0.0.404",
|
50
50
|
"@teambit/webpack.modules.config-mutator": "0.0.164",
|
51
|
-
"@teambit/bundler": "1.0.
|
52
|
-
"@teambit/logger": "0.0.
|
53
|
-
"@teambit/cli": "0.0.
|
54
|
-
"@teambit/pubsub": "1.0.
|
55
|
-
"@teambit/workspace": "1.0.
|
51
|
+
"@teambit/bundler": "1.0.105",
|
52
|
+
"@teambit/logger": "0.0.931",
|
53
|
+
"@teambit/cli": "0.0.838",
|
54
|
+
"@teambit/pubsub": "1.0.105",
|
55
|
+
"@teambit/workspace": "1.0.105",
|
56
56
|
"@teambit/webpack.modules.generate-expose-loaders": "0.0.14",
|
57
57
|
"@teambit/webpack.modules.generate-externals": "0.0.15",
|
58
|
-
"@teambit/webpack.plugins.inject-head-webpack-plugin": "0.0.
|
58
|
+
"@teambit/webpack.plugins.inject-head-webpack-plugin": "0.0.8"
|
59
59
|
},
|
60
60
|
"devDependencies": {
|
61
61
|
"@types/webpack": "5.28.1",
|
@@ -69,7 +69,7 @@
|
|
69
69
|
"@types/testing-library__jest-dom": "5.9.5"
|
70
70
|
},
|
71
71
|
"peerDependencies": {
|
72
|
-
"@teambit/legacy": "1.0.
|
72
|
+
"@teambit/legacy": "1.0.623",
|
73
73
|
"react": "^16.8.0 || ^17.0.0",
|
74
74
|
"react-dom": "^16.8.0 || ^17.0.0"
|
75
75
|
},
|