Skip to content

Commit

Permalink
better plugin to copy static assets
Browse files Browse the repository at this point in the history
  • Loading branch information
qunash committed Jan 13, 2023
1 parent 1c7691f commit 30e0012
Show file tree
Hide file tree
Showing 7 changed files with 16 additions and 58 deletions.
10 changes: 4 additions & 6 deletions build.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import fs from "fs-extra";
import tailwindcss from "tailwindcss";
import autoprefixer from "autoprefixer";
import postcssPlugin from "esbuild-style-plugin";
import copyStaticFilesPlugin from "esbuild-plugin-copy";
import copyStaticFilesPlugin from "esbuild-copy-files-plugin";

const buildDir = "build";

Expand Down Expand Up @@ -35,11 +35,9 @@ async function runEsbuild() {
},
}),
copyStaticFilesPlugin({
resolveFrom: "cwd",
assets: {
from: ["src/manifest.json"],
to: [buildDir],
},
source: ["src/manifest.json", "src/assets/icons"],
target: buildDir,
copyWithFolder: true,
}),
],
});
Expand Down
62 changes: 11 additions & 51 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
"autoprefixer": "^10.4.13",
"chokidar-cli": "^3.0.0",
"esbuild": "^0.16.17",
"esbuild-plugin-copy": "^2.0.1",
"esbuild-copy-files-plugin": "^1.1.0",
"esbuild-style-plugin": "^1.6.1",
"eslint": "^8.20.0",
"eslint-config-preact": "^1.3.0",
Expand Down
Binary file added src/assets/icons/MaterialIcons-Regular!.woff2
Binary file not shown.
Binary file added src/assets/icons/icon128.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/assets/icons/icon16.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/assets/icons/icon48.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 30e0012

Please sign in to comment.