Skip to content

Commit

Permalink
build: fix missing css | resolves flatpickr#1061
Browse files Browse the repository at this point in the history
  • Loading branch information
chmln committed Oct 11, 2017
1 parent e4fb74f commit 7006cc7
Showing 1 changed file with 13 additions and 5 deletions.
18 changes: 13 additions & 5 deletions build.ts
Original file line number Diff line number Diff line change
Expand Up @@ -109,10 +109,13 @@ async function buildScripts() {
function buildExtras(folder: "plugins" | "l10n") {
return async function() {
console.log(`building ${folder}...`);
const src_paths = await resolveGlob(`./src/${folder}/**/*.ts`);
const [src_paths, css_paths] = await Promise.all([
resolveGlob(`./src/${folder}/**/*.ts`),
resolveGlob(`./src/${folder}/**/*.css`),
]);

await Promise.all(
src_paths.map(async sourcePath => {
await Promise.all([
...src_paths.map(async sourcePath => {
const bundle = await rollup.rollup({
...rollupConfig.inputOptions,
input: sourcePath,
Expand All @@ -122,8 +125,13 @@ function buildExtras(folder: "plugins" | "l10n") {
file: sourcePath.replace("src", "dist").replace(".ts", ".js"),
name: path.basename(sourcePath, path.extname(sourcePath)),
} as any);
})
);
}),
...css_paths.map(async p => {
fs
.createReadStream(p)
.pipe(fs.createWriteStream(p.replace("src", "dist")));
}),
]);

console.log("done.");
};
Expand Down

0 comments on commit 7006cc7

Please sign in to comment.