@dtwo/webpack-builder 3.1.2 → 3.2.0
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/index.mjs +23 -4
- package/package.json +6 -6
package/dist/index.mjs
CHANGED
|
@@ -16,19 +16,19 @@ import { createFsFromVolume, Volume } from 'memfs';
|
|
|
16
16
|
import VirtualModulesPlugin from 'webpack-virtual-modules';
|
|
17
17
|
import querystring from 'node:querystring';
|
|
18
18
|
import { BundleAnalyzerPlugin } from 'webpack-bundle-analyzer';
|
|
19
|
+
import ForkTSCheckerWebpackPlugin from '@dtwojs/fork-ts-checker-webpack-plugin';
|
|
19
20
|
import { cloneDeep, uniq, defaults as defaults$1, merge } from 'lodash-es';
|
|
20
21
|
import TimeFixPlugin from 'time-fix-plugin';
|
|
21
22
|
import WebpackBar from 'webpackbar';
|
|
22
23
|
import FriendlyErrorsWebpackPlugin from '@d2js/friendly-errors-webpack-plugin';
|
|
23
24
|
import escapeRegExp from 'escape-string-regexp';
|
|
24
|
-
import
|
|
25
|
+
import { EsbuildPlugin } from 'esbuild-loader';
|
|
25
26
|
import KduLoaderPlugin from 'kdu-loader/dist/pluginWebpack5.js';
|
|
26
27
|
import { normalizeWebpackManifest } from 'kdu-bundle-renderer';
|
|
27
28
|
import hash$1 from 'hash-sum';
|
|
28
29
|
import fse from 'fs-extra';
|
|
29
30
|
import MiniCssExtractPlugin from 'mini-css-extract-plugin';
|
|
30
31
|
import CssMinimizerPlugin from 'css-minimizer-webpack-plugin';
|
|
31
|
-
import ForkTSCheckerWebpackPlugin from 'fork-ts-checker-webpack-plugin';
|
|
32
32
|
|
|
33
33
|
const keyedFunctions = [
|
|
34
34
|
"useState",
|
|
@@ -471,7 +471,7 @@ function getEnv(ctx) {
|
|
|
471
471
|
function esbuild(ctx) {
|
|
472
472
|
const { config } = ctx;
|
|
473
473
|
const target = ctx.isServer ? "es2019" : "chrome85";
|
|
474
|
-
config.optimization.minimizer.push(new
|
|
474
|
+
config.optimization.minimizer.push(new EsbuildPlugin());
|
|
475
475
|
config.module.rules.push(
|
|
476
476
|
{
|
|
477
477
|
test: /\.m?[jt]s$/i,
|
|
@@ -970,6 +970,18 @@ function clientPlugins(ctx) {
|
|
|
970
970
|
...options.webpack.analyze === true ? {} : options.webpack.analyze
|
|
971
971
|
}));
|
|
972
972
|
}
|
|
973
|
+
if (!ctx.dtwo.options.ssr) {
|
|
974
|
+
if (ctx.dtwo.options.typescript.typeCheck === true || ctx.dtwo.options.typescript.typeCheck === "build" && !ctx.dtwo.options.dev) {
|
|
975
|
+
config.plugins.push(new ForkTSCheckerWebpackPlugin({
|
|
976
|
+
logger,
|
|
977
|
+
typescript: {
|
|
978
|
+
extensions: {
|
|
979
|
+
kdu: { compiler: "@kdujs/compiler-sfc" }
|
|
980
|
+
}
|
|
981
|
+
}
|
|
982
|
+
}));
|
|
983
|
+
}
|
|
984
|
+
}
|
|
973
985
|
}
|
|
974
986
|
|
|
975
987
|
function node(ctx) {
|
|
@@ -1066,7 +1078,14 @@ function serverPlugins(ctx) {
|
|
|
1066
1078
|
}));
|
|
1067
1079
|
}
|
|
1068
1080
|
if (ctx.dtwo.options.typescript.typeCheck === true || ctx.dtwo.options.typescript.typeCheck === "build" && !ctx.dtwo.options.dev) {
|
|
1069
|
-
config.plugins.push(new ForkTSCheckerWebpackPlugin({
|
|
1081
|
+
config.plugins.push(new ForkTSCheckerWebpackPlugin({
|
|
1082
|
+
logger,
|
|
1083
|
+
typescript: {
|
|
1084
|
+
extensions: {
|
|
1085
|
+
kdu: { compiler: "@kdujs/compiler-sfc" }
|
|
1086
|
+
}
|
|
1087
|
+
}
|
|
1088
|
+
}));
|
|
1070
1089
|
}
|
|
1071
1090
|
}
|
|
1072
1091
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dtwo/webpack-builder",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.2.0",
|
|
4
4
|
"repository": "d2js/dtwo",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -15,20 +15,20 @@
|
|
|
15
15
|
"dependencies": {
|
|
16
16
|
"@babel/core": "7.20.12",
|
|
17
17
|
"@d2js/friendly-errors-webpack-plugin": "2.5.2",
|
|
18
|
-
"@dtwo/kit": "3.
|
|
18
|
+
"@dtwo/kit": "3.2.0",
|
|
19
19
|
"@dtwo/unplugin": "1.0.0",
|
|
20
|
+
"@dtwojs/fork-ts-checker-webpack-plugin": "7.3.0",
|
|
20
21
|
"autoprefixer": "10.4.13",
|
|
21
22
|
"css-loader": "6.7.3",
|
|
22
23
|
"css-minimizer-webpack-plugin": "4.2.2",
|
|
23
24
|
"cssnano": "5.1.14",
|
|
24
|
-
"esbuild-loader": "
|
|
25
|
+
"esbuild-loader": "3.0.0",
|
|
25
26
|
"escape-string-regexp": "5.0.0",
|
|
26
27
|
"estree-walker": "3.0.3",
|
|
27
28
|
"file-loader": "6.2.0",
|
|
28
|
-
"fork-ts-checker-webpack-plugin": "7.3.0",
|
|
29
29
|
"fs-extra": "11.1.0",
|
|
30
30
|
"hash-sum": "2.0.0",
|
|
31
|
-
"kdu-bundle-renderer": "1.0.
|
|
31
|
+
"kdu-bundle-renderer": "1.0.1",
|
|
32
32
|
"kdu-loader": "17.0.0",
|
|
33
33
|
"lodash-es": "4.17.21",
|
|
34
34
|
"magic-string": "0.27.0",
|
|
@@ -54,7 +54,7 @@
|
|
|
54
54
|
"webpackbar": "5.0.2"
|
|
55
55
|
},
|
|
56
56
|
"devDependencies": {
|
|
57
|
-
"@dtwo/schema": "3.
|
|
57
|
+
"@dtwo/schema": "3.2.0",
|
|
58
58
|
"@types/lodash-es": "4.17.6",
|
|
59
59
|
"@types/pify": "5.0.1",
|
|
60
60
|
"@types/webpack-bundle-analyzer": "4.6.0",
|