Skip to content

Commit

Permalink
added svg file loader
Browse files Browse the repository at this point in the history
  • Loading branch information
FinnIckler committed Jun 5, 2023
1 parent 69be033 commit 6cd9195
Showing 1 changed file with 23 additions and 20 deletions.
43 changes: 23 additions & 20 deletions build.js
Original file line number Diff line number Diff line change
@@ -1,27 +1,30 @@
const { build } = require("esbuild");
const { build } = require('esbuild')
const { sassPlugin } = require('esbuild-sass-plugin')
const { nodeExternalsPlugin } = require('esbuild-node-externals');
const { nodeExternalsPlugin } = require('esbuild-node-externals')

const entryFile = "src/index.ts";
const entryFile = 'src/index.ts'
const shared = {
bundle: true,
entryPoints: [entryFile],
logLevel: "info",
minify: true,
sourcemap: true,
plugins: [sassPlugin(), nodeExternalsPlugin()]
};
bundle: true,
entryPoints: [entryFile],
logLevel: 'info',
minify: true,
sourcemap: true,
plugins: [sassPlugin(), nodeExternalsPlugin()],
loader: {
'.svg': 'file',
},
}

build({
...shared,
format: "esm",
outfile: "./dist/index.esm.js",
target: ["esnext", "node12.22.0"],
});
...shared,
format: 'esm',
outfile: './dist/index.esm.js',
target: ['esnext', 'node12.22.0'],
})

build({
...shared,
format: "cjs",
outfile: "./dist/index.cjs.js",
target: ["esnext", "node12.22.0"],
});
...shared,
format: 'cjs',
outfile: './dist/index.cjs.js',
target: ['esnext', 'node12.22.0'],
})

0 comments on commit 6cd9195

Please sign in to comment.