Skip to content

Commit

Permalink
Create custom filename=>module mappings | fixes flatpickr#1075
Browse files Browse the repository at this point in the history
  • Loading branch information
chmln committed Nov 2, 2017
1 parent 921e0c0 commit 9cf7c52
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion build.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@ const paths = {
l10n: "./src/l10n",
};

const customModuleNames: Record<string, string> = {
confirmDate: "confirmDatePlugin",
};

const rollupConfig = {
inputOptions: {
input: "",
Expand Down Expand Up @@ -121,10 +125,13 @@ function buildExtras(folder: "plugins" | "l10n") {
...rollupConfig.inputOptions,
input: sourcePath,
} as any);

const fileName = path.basename(sourcePath, path.extname(sourcePath));

return bundle.write({
...rollupConfig.outputOptions,
file: sourcePath.replace("src", "dist").replace(".ts", ".js"),
name: path.basename(sourcePath, path.extname(sourcePath)),
name: customModuleNames[fileName] || fileName,
} as any);
}),
...css_paths.map(async p => {
Expand Down

0 comments on commit 9cf7c52

Please sign in to comment.