-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #55 from Namide/feature/web-workers
Feature/web workers
- Loading branch information
Showing
16 changed files
with
915 additions
and
393 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,54 +1,54 @@ | ||
import path from "path"; | ||
import { defineConfig } from "vite"; | ||
import { UserConfig } from "vite"; | ||
|
||
export default () => { | ||
return defineConfig({ | ||
define: { | ||
// __DEV__: JSON.stringify(`process.env.NODE_ENV !== "production"`) | ||
export default { | ||
define: { | ||
// __DEV__: JSON.stringify(`process.env.NODE_ENV !== "production"`) | ||
}, | ||
build: { | ||
sourcemap: true, | ||
lib: { | ||
entry: path.resolve(__dirname, "../src/extractColors.ts"), | ||
name: "ExtractColors", | ||
fileName: (format) => | ||
`extract-colors.${format === "es" ? "mjs" : format}`, | ||
formats: ["cjs", "es"], | ||
}, | ||
build: { | ||
sourcemap: true, | ||
lib: { | ||
entry: path.resolve(__dirname, "../src/extractColors.ts"), | ||
name: "ExtractColors", | ||
fileName: (format) => | ||
`extract-colors.${format === "es" ? "mjs" : format}`, | ||
formats: ["cjs", "es"], | ||
}, | ||
minify: "terser", | ||
terserOptions: { | ||
mangle: { | ||
properties: { | ||
reserved: [ | ||
"pixels", | ||
"distance", | ||
"colorValidator", | ||
"hueDistance", | ||
"saturationDistance", | ||
"lightnessDistance", | ||
"crossOrigin", | ||
"hex", | ||
"red", | ||
"green", | ||
"blue", | ||
"area", | ||
"hue", | ||
"saturation", | ||
"lightness", | ||
"intensity", | ||
"extractColors", | ||
"extractColorsFromImage", | ||
"extractColorsFromImageData", | ||
"extractColorsFromSrc", | ||
], | ||
}, | ||
minify: "terser", | ||
terserOptions: { | ||
mangle: { | ||
properties: { | ||
reserved: [ | ||
"pixels", | ||
"distance", | ||
"colorValidator", | ||
"hueDistance", | ||
"saturationDistance", | ||
"lightnessDistance", | ||
"crossOrigin", | ||
"requestMode", | ||
"hex", | ||
"red", | ||
"green", | ||
"blue", | ||
"area", | ||
"hue", | ||
"saturation", | ||
"lightness", | ||
"intensity", | ||
"extractColors", | ||
"extractColorsFromImage", | ||
"extractColorsFromImageData", | ||
"extractColorsFromImageBitmap", | ||
"extractColorsFromSrc", | ||
], | ||
}, | ||
}, | ||
rollupOptions: { | ||
output: { | ||
dir: "./lib", | ||
}, | ||
}, | ||
rollupOptions: { | ||
output: { | ||
dir: "./lib", | ||
}, | ||
}, | ||
}); | ||
}; | ||
}, | ||
} satisfies UserConfig; |
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 |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import path from "path"; | ||
import { UserConfig } from "vite"; | ||
import conf from "./vite.config"; | ||
|
||
export default { | ||
...conf, | ||
// define: { | ||
// __DEV__: JSON.stringify(`process.env.NODE_ENV !== "production"`), | ||
// }, | ||
build: { | ||
...conf.build, | ||
emptyOutDir: false, | ||
lib: { | ||
entry: path.resolve(__dirname, "../src/workerWrapper.ts"), | ||
name: "ExtractColors", | ||
fileName: (format) => | ||
`worker-wrapper.${format === "es" ? "mjs" : format}`, | ||
formats: ["cjs", "es"], | ||
}, | ||
}, | ||
} satisfies UserConfig; |
Oops, something went wrong.