-
Notifications
You must be signed in to change notification settings - Fork 42
Expand file tree
/
Copy pathwebpack.image.config.js
More file actions
44 lines (40 loc) · 1.49 KB
/
webpack.image.config.js
File metadata and controls
44 lines (40 loc) · 1.49 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
const path = require("path");
const config = require("./config/default");
module.exports = {
mode: "production",
entry: "./imageDynamicImport.ts",
module: {
rules: [
{
test: /\.tsx?$/,
use: "ts-loader",
exclude: /node_modules/,
},
{
test: /\.(png|svg|jpg|gif)$/,
type: "asset/resource",
generator: {
// Generator options for asset modules
// Emit an output asset from this asset module. This can be set to 'false' to omit emitting e. g. for SSR.
// type: boolean
emit: true,
filename: "[name][ext]",
// // Customize publicPath for asset modules, available since webpack 5.28.0
// // type: string | ((pathData: PathData, assetInfo?: AssetInfo) => string)
publicPath: "images/",
// Emit the asset in the specified folder relative to 'output.path', available since webpack 5.67.0
// type: string | ((pathData: PathData, assetInfo?: AssetInfo) => string)
outputPath: "images/",
},
},
],
},
resolve: {
extensions: [".tsx", ".ts", ".js"],
},
output: {
filename: "imageImportChunk.js",
path: path.resolve(__dirname, config.buildConfig.targetDir),
clean: true,
},
};