refactor(webpack): rewrite config to typescript
This commit is contained in:
parent
c17cca2b6f
commit
1ce1180ad7
Binary file not shown.
4
src/global.d.ts
vendored
4
src/global.d.ts
vendored
@ -1,5 +1 @@
|
|||||||
/// <reference types="ksv741-react-scripts/global" />
|
/// <reference types="ksv741-react-scripts/global" />
|
||||||
|
|
||||||
declare module '*.css' {
|
|
||||||
export default Record<string, string>;
|
|
||||||
}
|
|
||||||
|
|||||||
@ -3,6 +3,7 @@
|
|||||||
"./src",
|
"./src",
|
||||||
"./configs",
|
"./configs",
|
||||||
"./jest.config.ts",
|
"./jest.config.ts",
|
||||||
|
"./webpack.config.ts",
|
||||||
"./__spec__",
|
"./__spec__",
|
||||||
],
|
],
|
||||||
"compilerOptions": {
|
"compilerOptions": {
|
||||||
@ -51,5 +52,10 @@
|
|||||||
"DOM"
|
"DOM"
|
||||||
],
|
],
|
||||||
"skipLibCheck": true
|
"skipLibCheck": true
|
||||||
|
},
|
||||||
|
"ts-node": {
|
||||||
|
"compilerOptions": {
|
||||||
|
"module": "CommonJS"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,13 +0,0 @@
|
|||||||
const path = require('node:path');
|
|
||||||
|
|
||||||
const { createConfig } = require('ksv741-react-scripts');
|
|
||||||
|
|
||||||
module.exports = (env) => createConfig({
|
|
||||||
analyze: env?.analyze,
|
|
||||||
mode: env?.mode,
|
|
||||||
plugins: {
|
|
||||||
htmlWebpackPlugin: {
|
|
||||||
favicon: path.resolve(__dirname, 'public', 'favicon.png'),
|
|
||||||
},
|
|
||||||
},
|
|
||||||
});
|
|
||||||
14
webpack.config.ts
Normal file
14
webpack.config.ts
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
import path from 'path';
|
||||||
|
import {createConfig, WebpackEnv} from 'ksv741-react-scripts'
|
||||||
|
|
||||||
|
const config = (env: WebpackEnv) => createConfig({
|
||||||
|
analyze: Boolean(env?.analyze),
|
||||||
|
mode: env?.mode || 'development',
|
||||||
|
plugins: {
|
||||||
|
htmlWebpackPlugin: {
|
||||||
|
favicon: path.resolve(__dirname, 'public', 'favicon.png'),
|
||||||
|
},
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
export default config;
|
||||||
Loading…
x
Reference in New Issue
Block a user