@teambit/webpack 0.0.1068 → 0.0.1069
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/config/webpack.dev.config.ts +20 -21
- package/dist/config/webpack.dev.config.js +12 -17
- package/dist/config/webpack.dev.config.js.map +1 -1
- package/dist/{preview-1685503265901.js → preview-1685613946070.js} +2 -2
- package/package-tar/teambit-webpack-0.0.1069.tgz +0 -0
- package/package.json +7 -7
- package/package-tar/teambit-webpack-0.0.1068.tgz +0 -0
|
@@ -109,30 +109,29 @@ export function configFactory(
|
|
|
109
109
|
overlay: false,
|
|
110
110
|
},
|
|
111
111
|
|
|
112
|
-
|
|
113
|
-
|
|
112
|
+
setupMiddlewares: (middlewares, devServer) => {
|
|
113
|
+
if (!devServer) {
|
|
114
|
+
throw new Error('webpack-dev-server is not defined');
|
|
115
|
+
}
|
|
116
|
+
|
|
114
117
|
// Keep `evalSourceMapMiddleware` and `errorOverlayMiddleware`
|
|
115
118
|
// middlewares before `redirectServedPath` otherwise will not have any effect
|
|
116
119
|
// This lets us fetch source contents from webpack for the error overlay
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
// it used the same host and port.
|
|
133
|
-
// https://github.com/facebook/create-react-app/issues/2272#issuecomment-302832432
|
|
134
|
-
// @ts-ignore
|
|
135
|
-
app.use(noopServiceWorkerMiddleware(publicUrlOrPath));
|
|
120
|
+
middlewares.push(
|
|
121
|
+
// @ts-ignore @types/wds mismatch
|
|
122
|
+
evalSourceMapMiddleware(devServer),
|
|
123
|
+
// This lets us open files from the runtime error overlay.
|
|
124
|
+
errorOverlayMiddleware(),
|
|
125
|
+
// Redirect to `PUBLIC_URL` or `homepage` from `package.json` if url not match
|
|
126
|
+
redirectServedPath(publicUrlOrPath),
|
|
127
|
+
// This service worker file is effectively a 'no-op' that will reset any
|
|
128
|
+
// previous service worker registered for the same host:port combination.
|
|
129
|
+
// We do this in development to avoid hitting the production cache if
|
|
130
|
+
// it used the same host and port.
|
|
131
|
+
// https://github.com/facebook/create-react-app/issues/2272#issuecomment-302832432
|
|
132
|
+
noopServiceWorkerMiddleware(publicUrlOrPath)
|
|
133
|
+
);
|
|
134
|
+
return middlewares;
|
|
136
135
|
},
|
|
137
136
|
|
|
138
137
|
devMiddleware: {
|
|
@@ -166,33 +166,28 @@ function configFactory(devServerID, workspaceDir, entryFiles, publicRoot, public
|
|
|
166
166
|
client: {
|
|
167
167
|
overlay: false
|
|
168
168
|
},
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
}
|
|
169
|
+
setupMiddlewares: (middlewares, devServer) => {
|
|
170
|
+
if (!devServer) {
|
|
171
|
+
throw new Error('webpack-dev-server is not defined');
|
|
172
|
+
}
|
|
173
|
+
|
|
173
174
|
// Keep `evalSourceMapMiddleware` and `errorOverlayMiddleware`
|
|
174
175
|
// middlewares before `redirectServedPath` otherwise will not have any effect
|
|
175
176
|
// This lets us fetch source contents from webpack for the error overlay
|
|
176
|
-
|
|
177
|
-
|
|
177
|
+
middlewares.push(
|
|
178
|
+
// @ts-ignore @types/wds mismatch
|
|
179
|
+
(0, _evalSourceMapMiddleware().default)(devServer),
|
|
178
180
|
// This lets us open files from the runtime error overlay.
|
|
179
|
-
|
|
180
|
-
app.use((0, _errorOverlayMiddleware().default)());
|
|
181
|
-
},
|
|
182
|
-
onAfterSetupMiddleware({
|
|
183
|
-
app
|
|
184
|
-
}) {
|
|
181
|
+
(0, _errorOverlayMiddleware().default)(),
|
|
185
182
|
// Redirect to `PUBLIC_URL` or `homepage` from `package.json` if url not match
|
|
186
|
-
|
|
187
|
-
app.use((0, _redirectServedPathMiddleware().default)(publicUrlOrPath));
|
|
188
|
-
|
|
183
|
+
(0, _redirectServedPathMiddleware().default)(publicUrlOrPath),
|
|
189
184
|
// This service worker file is effectively a 'no-op' that will reset any
|
|
190
185
|
// previous service worker registered for the same host:port combination.
|
|
191
186
|
// We do this in development to avoid hitting the production cache if
|
|
192
187
|
// it used the same host and port.
|
|
193
188
|
// https://github.com/facebook/create-react-app/issues/2272#issuecomment-302832432
|
|
194
|
-
|
|
195
|
-
|
|
189
|
+
(0, _noopServiceWorkerMiddleware().default)(publicUrlOrPath));
|
|
190
|
+
return middlewares;
|
|
196
191
|
},
|
|
197
192
|
devMiddleware: {
|
|
198
193
|
// forward static files
|
|
@@ -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","
|
|
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","setupMiddlewares","middlewares","Error","push","evalSourceMapMiddleware","errorOverlayMiddleware","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: '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 },\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 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}\n"],"mappings":";;;;;;;AAAA;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;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAEA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAEA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAEA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAEA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAEA,MAAMA,eAAe,GAAG,IAAAC,6BAAkB,EAACC,OAAO,CAACC,GAAG,CAACC,QAAQ,KAAK,aAAa,EAAE,GAAG,EAAE,SAAS,CAAC;AAE3F,SAASC,aAAa,CAC3BC,WAAmB,EACnBC,YAAoB,EACpBC,UAAoB,EACpBC,UAAkB,EAClBC,UAAkB,EAClBC,MAAkB,EAClBC,KAAc,EACdC,OAAgB,EACY;EAC5B,MAAMC,oBAAoB,GAAIC,YAAY,IAAKC,eAAI,CAACC,OAAO,CAACV,YA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AAW,EAAEf,SAAS,KAAK;QAC5C,IAAI,CAACA,SAAS,EAAE;UACd,MAAM,IAAIgB,KAAK,CAAC,mCAAmC,CAAC;QACtD;;QAEA;QACA;QACA;QACAD,WAAW,CAACE,IAAI;QACd;QACA,IAAAC,kCAAuB,EAAClB,SAAS,CAAC;QAClC;QACA,IAAAmB,iCAAsB,GAAE;QACxB;QACA,IAAAC,uCAAkB,EAACxD,eAAe,CAAC;QACnC;QACA;QACA;QACA;QACA;QACA,IAAAyD,sCAA2B,EAACzD,eAAe,CAAC,CAC7C;QACD,OAAOmD,WAAW;MACpB,CAAC;MAEDO,aAAa,EAAE;QACb;QACAhD,UAAU,EAAEM,eAAI,CAAC2C,IAAI,CAAC,GAAG,EAAElD,UAAU;MACvC;IACF,CAAC;IAEDQ,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;QAAEL;MAAY;IACjC,CAAC,CAAC;EAEN,CAAC;AACH"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import * as compositions_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.webpack_webpack@0.0.
|
|
2
|
-
import * as overview_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.webpack_webpack@0.0.
|
|
1
|
+
import * as compositions_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.webpack_webpack@0.0.1069/dist/webpack.composition.js';
|
|
2
|
+
import * as overview_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.webpack_webpack@0.0.1069/dist/webpack.docs.mdx';
|
|
3
3
|
|
|
4
4
|
export const compositions = [compositions_0];
|
|
5
5
|
export const overview = [overview_0];
|
|
Binary file
|
package/package.json
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@teambit/webpack",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.1069",
|
|
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": "0.0.
|
|
9
|
+
"version": "0.0.1069"
|
|
10
10
|
},
|
|
11
11
|
"dependencies": {
|
|
12
|
-
"webpack": "5.
|
|
12
|
+
"webpack": "5.84.1",
|
|
13
13
|
"lodash": "4.17.21",
|
|
14
14
|
"p-map-series": "2.1.0",
|
|
15
15
|
"find-root": "1.1.0",
|
|
@@ -46,13 +46,13 @@
|
|
|
46
46
|
"core-js": "^3.0.0",
|
|
47
47
|
"@babel/runtime": "7.20.0",
|
|
48
48
|
"@teambit/harmony": "0.4.6",
|
|
49
|
-
"@teambit/webpack.modules.config-mutator": "0.0.
|
|
49
|
+
"@teambit/webpack.modules.config-mutator": "0.0.158",
|
|
50
50
|
"@teambit/bit-error": "0.0.402",
|
|
51
|
-
"@teambit/bundler": "0.0.
|
|
51
|
+
"@teambit/bundler": "0.0.1069",
|
|
52
52
|
"@teambit/logger": "0.0.814",
|
|
53
53
|
"@teambit/cli": "0.0.721",
|
|
54
|
-
"@teambit/pubsub": "0.0.
|
|
55
|
-
"@teambit/workspace": "0.0.
|
|
54
|
+
"@teambit/pubsub": "0.0.1069",
|
|
55
|
+
"@teambit/workspace": "0.0.1069",
|
|
56
56
|
"@teambit/webpack.modules.generate-expose-loaders": "0.0.10",
|
|
57
57
|
"@teambit/webpack.modules.generate-externals": "0.0.11",
|
|
58
58
|
"@teambit/webpack.plugins.inject-head-webpack-plugin": "0.0.3"
|
|
Binary file
|