Skip to content

Commit

Permalink
use multiple entrypoints for parcel (#67)
Browse files Browse the repository at this point in the history
  • Loading branch information
stefanfrede authored and drwpow committed Jul 27, 2020
1 parent 40a791e commit 2e16437
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions packages/create-snowpack-app/packages/plugin-parcel/plugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ const execa = require("execa");
const npmRunPath = require("npm-run-path");
const { copy } = require("fs-extra");
const cwd = process.cwd();
const util = require("util");
const glob = require("glob");
const readFolderAsync = util.promisify(glob);

module.exports = function parcelBundlePlugin(config, options) {
return {
Expand Down Expand Up @@ -60,12 +63,11 @@ module.exports = function parcelBundlePlugin(config, options) {
.unlink(path.join(srcDirectory, ".postcssrc.js"))
.catch((/* ignore */) => null);

const parcelOptions = [
"build",
config.devOptions.fallback,
"--out-dir",
destDirectory,
];
// Get all html files from the output folder
const pattern = config.devOptions.out + "/**/*.html";
const files = await readFolderAsync(pattern);

const parcelOptions = ["build", ...files, "--out-dir", destDirectory];

if (config.homepage) {
parcelOptions.push("--public-url", config.homepage);
Expand Down

0 comments on commit 2e16437

Please sign in to comment.