Skip to content

Commit db5eaeb

Browse files
committed
Replace ts-loader with esbuild-loader in webpack configuration
- make builds faster └── apps └── editor ├── package.json ├── src │ └── extension.ts └── webpack.config.ts
1 parent e687364 commit db5eaeb

3 files changed

Lines changed: 18 additions & 16 deletions

File tree

‎apps/editor/package.json‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1234,7 +1234,6 @@
12341234
"sass-loader": "^12.6.0",
12351235
"style-loader": "^3.3.4",
12361236
"ts-node": "^10.9.2",
1237-
"ts-loader": "^9.5.2",
12381237
"typed-css-modules": "^0.9.1",
12391238
"webpack": "^5.109.2",
12401239
"webpack-cli": "^6.0.1"

‎apps/editor/webpack.config.ts‎

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import CopyWebpackPlugin from 'copy-webpack-plugin'
55
import { CleanWebpackPlugin } from 'clean-webpack-plugin'
66
import MiniCssExtractPlugin from 'mini-css-extract-plugin'
77
import ForkTsCheckerWebpackPlugin from 'fork-ts-checker-webpack-plugin'
8+
import { EsbuildPlugin } from 'esbuild-loader'
89

910
const config: ((env: any, argv: any) => webpack.Configuration)[] = [
1011
// Extension Configuration (Node.js environment)
@@ -24,7 +25,14 @@ const config: ((env: any, argv: any) => webpack.Configuration)[] = [
2425
libraryTarget: 'commonjs2',
2526
devtoolModuleFilenameTemplate: '../[resource-path]'
2627
},
27-
devtool: is_production ? false : 'eval-source-map',
28+
devtool: is_production ? false : 'eval-cheap-module-source-map',
29+
optimization: {
30+
minimizer: [
31+
new EsbuildPlugin({
32+
target: 'es2022'
33+
})
34+
]
35+
},
2836
cache: {
2937
type: 'filesystem',
3038
buildDependencies: {
@@ -118,7 +126,15 @@ const config: ((env: any, argv: any) => webpack.Configuration)[] = [
118126
performance: {
119127
hints: false
120128
},
121-
devtool: isProduction ? false : 'eval-source-map',
129+
devtool: isProduction ? false : 'eval-cheap-module-source-map',
130+
optimization: {
131+
minimizer: [
132+
new EsbuildPlugin({
133+
target: 'es2022',
134+
css: true
135+
})
136+
]
137+
},
122138
cache: {
123139
type: 'filesystem',
124140
buildDependencies: {

‎pnpm-lock.yaml‎

Lines changed: 0 additions & 13 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)