@teambit/webpack 0.0.771 → 0.0.772
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.config.ts +3 -9
- package/dist/config/webpack.config.js +1 -10
- package/dist/config/webpack.config.js.map +1 -1
- package/package-tar/teambit-webpack-0.0.772.tgz +0 -0
- package/package.json +8 -8
- package/{preview-1656339215962.js → preview-1656362028747.js} +2 -2
- package/package-tar/teambit-webpack-0.0.771.tgz +0 -0
package/config/webpack.config.ts
CHANGED
|
@@ -102,23 +102,17 @@ function generateHtmlPlugins(configs: BundlerHtmlConfig[]) {
|
|
|
102
102
|
}
|
|
103
103
|
|
|
104
104
|
function generateHtmlPlugin(config: BundlerHtmlConfig) {
|
|
105
|
-
const baseConfig = {
|
|
105
|
+
const baseConfig: HtmlWebpackPlugin.Options = {
|
|
106
106
|
filename: config.filename,
|
|
107
107
|
chunks: config.chunks,
|
|
108
|
+
chunksSortMode: config.chunkOrder,
|
|
108
109
|
title: config.title,
|
|
109
110
|
templateContent: config.templateContent,
|
|
110
111
|
minify: config.minify,
|
|
111
112
|
cache: false,
|
|
112
|
-
chunksSortMode: 'auto' as const,
|
|
113
113
|
favicon: config.favicon,
|
|
114
114
|
};
|
|
115
|
-
|
|
116
|
-
// Make sure the order is that the preview root coming after the preview def
|
|
117
|
-
// we can't make it like this on the entries using depend on because this will
|
|
118
|
-
// prevent the splitting between different preview defs
|
|
119
|
-
// @ts-ignore
|
|
120
|
-
baseConfig.chunksSortMode = 'manual' as const;
|
|
121
|
-
}
|
|
115
|
+
|
|
122
116
|
const filteredConfig = omitBy(baseConfig, isUndefined);
|
|
123
117
|
return new HtmlWebpackPlugin(filteredConfig);
|
|
124
118
|
}
|
|
@@ -197,22 +197,13 @@ function generateHtmlPlugin(config) {
|
|
|
197
197
|
const baseConfig = {
|
|
198
198
|
filename: config.filename,
|
|
199
199
|
chunks: config.chunks,
|
|
200
|
+
chunksSortMode: config.chunkOrder,
|
|
200
201
|
title: config.title,
|
|
201
202
|
templateContent: config.templateContent,
|
|
202
203
|
minify: config.minify,
|
|
203
204
|
cache: false,
|
|
204
|
-
chunksSortMode: 'auto',
|
|
205
205
|
favicon: config.favicon
|
|
206
206
|
};
|
|
207
|
-
|
|
208
|
-
if (baseConfig.chunks && baseConfig.chunks.length) {
|
|
209
|
-
// Make sure the order is that the preview root coming after the preview def
|
|
210
|
-
// we can't make it like this on the entries using depend on because this will
|
|
211
|
-
// prevent the splitting between different preview defs
|
|
212
|
-
// @ts-ignore
|
|
213
|
-
baseConfig.chunksSortMode = 'manual';
|
|
214
|
-
}
|
|
215
|
-
|
|
216
207
|
const filteredConfig = (0, _lodash().omitBy)(baseConfig, _lodash().isUndefined);
|
|
217
208
|
return new (_htmlWebpackPlugin().default)(filteredConfig);
|
|
218
209
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["configFactory","target","context","truthyEntries","Array","isArray","entries","length","filter","Boolean","dev","development","htmlConfig","html","compress","htmlPlugins","generateHtmlPlugins","undefined","splitChunks","chunking","config","mode","bail","entry","infrastructureLogging","level","output","path","outputPath","sep","stats","errorDetails","resolve","alias","fallbacksAliases","fallback","fallbacks","plugins","webpack","ProvidePlugin","fallbacksProvidePluginConfig","getAssetManifestPlugin","filename","chunkFilename","runtimeChunkName","optimization","runtimeChunk","name","chunks","concat","CompressionPlugin","WebpackAssetsManifest","entrypoints","configs","map","generateHtmlPlugin","baseConfig","title","templateContent","minify","cache","
|
|
1
|
+
{"version":3,"names":["configFactory","target","context","truthyEntries","Array","isArray","entries","length","filter","Boolean","dev","development","htmlConfig","html","compress","htmlPlugins","generateHtmlPlugins","undefined","splitChunks","chunking","config","mode","bail","entry","infrastructureLogging","level","output","path","outputPath","sep","stats","errorDetails","resolve","alias","fallbacksAliases","fallback","fallbacks","plugins","webpack","ProvidePlugin","fallbacksProvidePluginConfig","getAssetManifestPlugin","filename","chunkFilename","runtimeChunkName","optimization","runtimeChunk","name","chunks","concat","CompressionPlugin","WebpackAssetsManifest","entrypoints","configs","map","generateHtmlPlugin","baseConfig","chunksSortMode","chunkOrder","title","templateContent","minify","cache","favicon","filteredConfig","omitBy","isUndefined","HtmlWebpackPlugin"],"sources":["webpack.config.ts"],"sourcesContent":["/* eslint-disable complexity */\nimport webpack, { Configuration } from 'webpack';\nimport { isUndefined, omitBy } from 'lodash';\nimport CompressionPlugin from 'compression-webpack-plugin';\nimport { sep } from 'path';\nimport type { BundlerContext, BundlerHtmlConfig, Target } from '@teambit/bundler';\nimport HtmlWebpackPlugin from 'html-webpack-plugin';\nimport WebpackAssetsManifest from 'webpack-assets-manifest';\nimport { fallbacks } from './webpack-fallbacks';\nimport { fallbacksProvidePluginConfig } from './webpack-fallbacks-provide-plugin-config';\nimport { fallbacksAliases } from './webpack-fallbacks-aliases';\n\nexport function configFactory(target: Target, context: BundlerContext): Configuration {\n let truthyEntries =\n Array.isArray(target.entries) && target.entries.length ? target.entries.filter(Boolean) : target.entries || {};\n if (Array.isArray(truthyEntries) && !truthyEntries.length) {\n truthyEntries = {};\n }\n\n const dev = Boolean(context.development);\n const htmlConfig = target.html ?? context.html;\n const compress = target.compress ?? context.compress;\n const htmlPlugins = htmlConfig ? generateHtmlPlugins(htmlConfig) : undefined;\n const splitChunks = target.chunking?.splitChunks;\n\n const config: Configuration = {\n mode: dev ? 'development' : 'production',\n // Stop compilation early in production\n bail: true,\n // These are the \"entry points\" to our application.\n // This means they will be the \"root\" imports that are included in JS bundle.\n // @ts-ignore\n entry: truthyEntries,\n\n infrastructureLogging: {\n level: 'error',\n },\n\n output: {\n // The build folder.\n path: `${target.outputPath}${sep}public`,\n },\n stats: {\n errorDetails: true,\n },\n\n resolve: {\n alias: fallbacksAliases,\n\n fallback: fallbacks,\n },\n\n plugins: [new webpack.ProvidePlugin(fallbacksProvidePluginConfig), getAssetManifestPlugin()],\n };\n\n if (target.filename) {\n config.output = config.output || {};\n config.output.filename = target.filename;\n }\n\n if (target.chunkFilename) {\n config.output = config.output || {};\n config.output.chunkFilename = target.chunkFilename;\n }\n\n if (target.runtimeChunkName) {\n config.optimization = config.optimization || {};\n config.optimization.runtimeChunk = {\n name: target.runtimeChunkName,\n };\n }\n\n if (splitChunks) {\n config.optimization = config.optimization || {};\n config.optimization.splitChunks = {\n chunks: 'all',\n name: false,\n };\n }\n\n if (htmlPlugins && htmlPlugins.length) {\n if (!config.plugins) {\n config.plugins = [];\n }\n config.plugins = config.plugins.concat(htmlPlugins);\n }\n if (compress) {\n if (!config.plugins) {\n config.plugins = [];\n }\n config.plugins = config.plugins.concat(new CompressionPlugin());\n }\n return config;\n}\n\nfunction getAssetManifestPlugin() {\n return new WebpackAssetsManifest({ entrypoints: true });\n}\n\nfunction generateHtmlPlugins(configs: BundlerHtmlConfig[]) {\n return configs.map((config) => generateHtmlPlugin(config));\n}\n\nfunction generateHtmlPlugin(config: BundlerHtmlConfig) {\n const baseConfig: HtmlWebpackPlugin.Options = {\n filename: config.filename,\n chunks: config.chunks,\n chunksSortMode: config.chunkOrder,\n title: config.title,\n templateContent: config.templateContent,\n minify: config.minify,\n cache: false,\n favicon: config.favicon,\n };\n\n const filteredConfig = omitBy(baseConfig, isUndefined);\n return new HtmlWebpackPlugin(filteredConfig);\n}\n"],"mappings":";;;;;;;;;;;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;;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;;AAVA;AAYO,SAASA,aAAT,CA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ACDjB,MAAM,CAACiB,OAAP,GAAiBjB,MAAM,CAACiB,OAAP,CAAeY,MAAf,CAAsB,KAAIC,mCAAJ,GAAtB,CAAjB;EACD;;EACD,OAAO9B,MAAP;AACD;;AAED,SAASqB,sBAAT,GAAkC;EAChC,OAAO,KAAIU,gCAAJ,EAA0B;IAAEC,WAAW,EAAE;EAAf,CAA1B,CAAP;AACD;;AAED,SAASpC,mBAAT,CAA6BqC,OAA7B,EAA2D;EACzD,OAAOA,OAAO,CAACC,GAAR,CAAalC,MAAD,IAAYmC,kBAAkB,CAACnC,MAAD,CAA1C,CAAP;AACD;;AAED,SAASmC,kBAAT,CAA4BnC,MAA5B,EAAuD;EACrD,MAAMoC,UAAqC,GAAG;IAC5Cd,QAAQ,EAAEtB,MAAM,CAACsB,QAD2B;IAE5CM,MAAM,EAAE5B,MAAM,CAAC4B,MAF6B;IAG5CS,cAAc,EAAErC,MAAM,CAACsC,UAHqB;IAI5CC,KAAK,EAAEvC,MAAM,CAACuC,KAJ8B;IAK5CC,eAAe,EAAExC,MAAM,CAACwC,eALoB;IAM5CC,MAAM,EAAEzC,MAAM,CAACyC,MAN6B;IAO5CC,KAAK,EAAE,KAPqC;IAQ5CC,OAAO,EAAE3C,MAAM,CAAC2C;EAR4B,CAA9C;EAWA,MAAMC,cAAc,GAAG,IAAAC,gBAAA,EAAOT,UAAP,EAAmBU,qBAAnB,CAAvB;EACA,OAAO,KAAIC,4BAAJ,EAAsBH,cAAtB,CAAP;AACD"}
|
|
Binary file
|
package/package.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@teambit/webpack",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.772",
|
|
4
4
|
"homepage": "https://bit.dev/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.772"
|
|
10
10
|
},
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"webpack": "5.51.1",
|
|
@@ -48,11 +48,11 @@
|
|
|
48
48
|
"@teambit/harmony": "0.3.3",
|
|
49
49
|
"@teambit/webpack.modules.config-mutator": "0.0.140",
|
|
50
50
|
"@teambit/bit-error": "0.0.394",
|
|
51
|
-
"@teambit/bundler": "0.0.
|
|
52
|
-
"@teambit/logger": "0.0.
|
|
53
|
-
"@teambit/cli": "0.0.
|
|
54
|
-
"@teambit/pubsub": "0.0.
|
|
55
|
-
"@teambit/workspace": "0.0.
|
|
51
|
+
"@teambit/bundler": "0.0.772",
|
|
52
|
+
"@teambit/logger": "0.0.604",
|
|
53
|
+
"@teambit/cli": "0.0.511",
|
|
54
|
+
"@teambit/pubsub": "0.0.772",
|
|
55
|
+
"@teambit/workspace": "0.0.772",
|
|
56
56
|
"@teambit/webpack.modules.generate-expose-loaders": "0.0.3",
|
|
57
57
|
"@teambit/webpack.modules.generate-externals": "0.0.4"
|
|
58
58
|
},
|
|
@@ -69,7 +69,7 @@
|
|
|
69
69
|
"@types/node": "12.20.4"
|
|
70
70
|
},
|
|
71
71
|
"peerDependencies": {
|
|
72
|
-
"@teambit/legacy": "1.0.
|
|
72
|
+
"@teambit/legacy": "1.0.292",
|
|
73
73
|
"react-dom": "^16.8.0 || ^17.0.0",
|
|
74
74
|
"react": "^16.8.0 || ^17.0.0"
|
|
75
75
|
},
|
|
@@ -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.772/dist/webpack.composition.js'
|
|
2
|
+
import * as overview_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.webpack_webpack@0.0.772/dist/webpack.docs.mdx'
|
|
3
3
|
|
|
4
4
|
export const compositions = [compositions_0];
|
|
5
5
|
export const overview = [overview_0]
|
|
Binary file
|