Skip to content

Commit

Permalink
Add just the necessary files to rollup watch mode
Browse files Browse the repository at this point in the history
  • Loading branch information
vstefanovic97 committed Jun 26, 2024
1 parent e84b82c commit 760a202
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 8 deletions.
8 changes: 2 additions & 6 deletions packages/addon-dev/src/rollup-keep-assets.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,6 @@ export default function keepAssets({
return {
name: 'copy-assets',

// Prior to https://github.com/rollup/rollup/pull/5270, we cannot call this
// from within `generateBundle`
buildStart() {
this.addWatchFile(from);
},

// imports of assets should be left alone in the source code. This can cover
// the case of .css as defined in the embroider v2 addon spec.
async resolveId(source, importer, options) {
Expand All @@ -44,6 +38,8 @@ export default function keepAssets({
globs: include,
directories: false,
})) {
this.addWatchFile(join(from, name));

this.emitFile({
type: 'asset',
fileName: name,
Expand Down
4 changes: 2 additions & 2 deletions packages/addon-dev/src/rollup-public-entrypoints.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,14 @@ export default function publicEntrypoints(args: {
return {
name: 'addon-modules',
async buildStart() {
this.addWatchFile(args.srcDir);

let matches = walkSync(args.srcDir, {
globs: [...args.include, '**/*.hbs', '**/*.ts', '**/*.gts', '**/*.gjs'],
ignore: args.exclude,
});

for (let name of matches) {
this.addWatchFile(path.join(args.srcDir, name));

// the matched file, but with the extension swapped with .js
let normalizedName = normalizeFileExt(name);

Expand Down

0 comments on commit 760a202

Please sign in to comment.