create-packer 1.25.6 → 1.25.8
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/package.json +1 -1
- package/template/web-app/react-webpack/README.md +13 -3
- package/template/web-app/react-webpack/global.d.ts +6 -7
- package/template/web-app/react-webpack/package.json +1 -0
- package/template/web-app/react-webpack/tsconfig.json +1 -1
- package/template/web-app/react-webpack/webpack.config.mjs +12 -1
package/package.json
CHANGED
|
@@ -1,4 +1,14 @@
|
|
|
1
|
-
# webpack
|
|
2
|
-
- dev: npm run dev
|
|
3
|
-
- build: npm run build
|
|
1
|
+
# react-app-webpack
|
|
4
2
|
|
|
3
|
+
- dev: pnpm run dev
|
|
4
|
+
- build: pnpm run build
|
|
5
|
+
- build:dev: pnpm run build:dev -> use ".env.dev"
|
|
6
|
+
|
|
7
|
+
# svg
|
|
8
|
+
|
|
9
|
+
- import IconReact from '@/assets/react.svg' -> ReactComponent
|
|
10
|
+
- import iconReact from '@/assets/react.svg?url' -> svg url
|
|
11
|
+
|
|
12
|
+
# style
|
|
13
|
+
|
|
14
|
+
- index.module.css -> css module
|
|
@@ -6,13 +6,12 @@ declare module '*.less'
|
|
|
6
6
|
declare module '*.scss'
|
|
7
7
|
declare module '*.png'
|
|
8
8
|
declare module '*.webp'
|
|
9
|
-
declare module '*.svg' {
|
|
10
|
-
import * as React from 'react'
|
|
11
|
-
|
|
12
|
-
export const ReactComponent: React.FunctionComponent<
|
|
13
|
-
React.ComponentProps<'svg'> & { title?: string }
|
|
14
|
-
>
|
|
15
|
-
export function ReactComponent(props: React.SVGProps<SVGSVGElement>): React.ReactElement
|
|
9
|
+
declare module '*.svg?url' {
|
|
16
10
|
const url: string
|
|
17
11
|
export default url
|
|
18
12
|
}
|
|
13
|
+
declare module '*.svg' {
|
|
14
|
+
import * as React from 'react'
|
|
15
|
+
function ReactComponent(props: React.SVGProps<SVGSVGElement>): React.ReactElement
|
|
16
|
+
export default ReactComponent
|
|
17
|
+
}
|
|
@@ -84,9 +84,20 @@ export default function (env) {
|
|
|
84
84
|
}
|
|
85
85
|
},
|
|
86
86
|
{
|
|
87
|
-
test: /\.(png|
|
|
87
|
+
test: /\.(png|jpg|jpeg|gif)$/i,
|
|
88
88
|
type: 'asset/resource'
|
|
89
89
|
},
|
|
90
|
+
{
|
|
91
|
+
test: /\.svg$/i,
|
|
92
|
+
type: 'asset/resource',
|
|
93
|
+
resourceQuery: /url/ // *.svg?url
|
|
94
|
+
},
|
|
95
|
+
{
|
|
96
|
+
test: /\.svg$/i,
|
|
97
|
+
issuer: /\.[jt]sx?$/,
|
|
98
|
+
resourceQuery: { not: [/url/] }, // exclude react component if *.svg?url
|
|
99
|
+
use: ['@svgr/webpack']
|
|
100
|
+
},
|
|
90
101
|
{
|
|
91
102
|
test: /\.(woff|woff2|eot|ttf|otf)$/i,
|
|
92
103
|
type: 'asset/resource'
|