Skip to content

Commit 6cd9195

Browse files
committed
added svg file loader
1 parent 69be033 commit 6cd9195

File tree

1 file changed

+23
-20
lines changed

1 file changed

+23
-20
lines changed

build.js

Lines changed: 23 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,30 @@
1-
const { build } = require("esbuild");
1+
const { build } = require('esbuild')
22
const { sassPlugin } = require('esbuild-sass-plugin')
3-
const { nodeExternalsPlugin } = require('esbuild-node-externals');
3+
const { nodeExternalsPlugin } = require('esbuild-node-externals')
44

5-
const entryFile = "src/index.ts";
5+
const entryFile = 'src/index.ts'
66
const shared = {
7-
bundle: true,
8-
entryPoints: [entryFile],
9-
logLevel: "info",
10-
minify: true,
11-
sourcemap: true,
12-
plugins: [sassPlugin(), nodeExternalsPlugin()]
13-
};
7+
bundle: true,
8+
entryPoints: [entryFile],
9+
logLevel: 'info',
10+
minify: true,
11+
sourcemap: true,
12+
plugins: [sassPlugin(), nodeExternalsPlugin()],
13+
loader: {
14+
'.svg': 'file',
15+
},
16+
}
1417

1518
build({
16-
...shared,
17-
format: "esm",
18-
outfile: "./dist/index.esm.js",
19-
target: ["esnext", "node12.22.0"],
20-
});
19+
...shared,
20+
format: 'esm',
21+
outfile: './dist/index.esm.js',
22+
target: ['esnext', 'node12.22.0'],
23+
})
2124

2225
build({
23-
...shared,
24-
format: "cjs",
25-
outfile: "./dist/index.cjs.js",
26-
target: ["esnext", "node12.22.0"],
27-
});
26+
...shared,
27+
format: 'cjs',
28+
outfile: './dist/index.cjs.js',
29+
target: ['esnext', 'node12.22.0'],
30+
})

0 commit comments

Comments
 (0)