-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Generate individual icons (#39)
* Generate individual icons * Fix SSR for elements
- Loading branch information
1 parent
c61b0ca
commit dd74394
Showing
3 changed files
with
26 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,23 @@ | ||
import esbuild from 'esbuild'; | ||
import esbuild from "esbuild"; | ||
import { glob } from "glob"; | ||
import chalk from "chalk"; | ||
|
||
await esbuild.build({ | ||
entryPoints: ['elements/index.js'], | ||
bundle: true, | ||
outfile: 'dist/elements/icons.js', | ||
format: 'esm', | ||
sourcemap: true, | ||
target: 'es2017', | ||
minify: true, | ||
external: ['lit'], | ||
const files = glob.sync("elements/*.js"); | ||
|
||
files.forEach(async (filePath) => { | ||
console.log(`${chalk.cyan("elements")}: Building elements icon ${chalk.yellow(filePath)} `); | ||
try { | ||
await esbuild.build({ | ||
entryPoints: [filePath], | ||
bundle: true, | ||
outfile: `dist/${filePath}`, | ||
format: "esm", | ||
sourcemap: true, | ||
target: "es2017", | ||
minify: true, | ||
external: ["lit"], | ||
}); | ||
} catch (err) { | ||
console.error(err); | ||
} | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters