Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/fuzzy-garlics-develop.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@aiou/react-template": patch
---

import.meta in webpack with esbuild-loader
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@
- **Setup** - `pnpm * pnpm dev`
- **Build** - `pnpm build`

## known issues

- [#12 - `import.meta` with `esbuild-loader`](https://github.com/neo-hack/react-template/issues/12)

## refs

- https://stackoverflow.com/questions/35412137/how-to-get-access-to-webpack-dev-server-from-devices-in-local-network
4 changes: 3 additions & 1 deletion build/webpack.common.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,9 @@ const common = {
loader: 'esbuild-loader',
options: {
loader: 'tsx',
target: 'es2015',
// according to https://web.dev/publish-modern-javascript/
// es2017 support 95% browsers
target: 'es2017',
},
},
],
Expand Down
7 changes: 4 additions & 3 deletions build/webpack.prod.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ const prod = {
terserOptions: {
warnings: false,
compress: {
drop_console: true,
drop_console: false,
},
},
}),
Expand Down Expand Up @@ -89,8 +89,9 @@ const prod = {
loader: 'css-loader',
options: {
sourceMap: true,
modules: true,
localIdentName: '[name]_[local]___[hash:base64:5]',
modules: {
localIdentName: '[name]_[local]___[hash:base64:5]',
},
},
},
{ loader: 'postcss-loader', options: { sourceMap: true } },
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@
"@types/react-router-dom": "5.3.3",
"@types/react-test-renderer": "18.0.0",
"@types/webpack-bundle-analyzer": "4.4.1",
"@types/webpack-env": "1.16.3",
"@types/webpack-env": "1.17.0",
"@vue/preload-webpack-plugin": "2.0.0",
"autoprefixer": "10.4.7",
"clean-webpack-plugin": "4.0.0",
Expand Down
Loading