Skip to content

Commit

Permalink
Merge pull request #1721 from embroider-build/merge-stable
Browse files Browse the repository at this point in the history
Merge stable into main
  • Loading branch information
mansona authored Dec 13, 2023
2 parents efd9117 + 954e270 commit 8bea275
Show file tree
Hide file tree
Showing 7 changed files with 212 additions and 438 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
"eslint-plugin-prettier": "^4.2.1",
"jest": "^29.2.1",
"prettier": "^2.3.1",
"release-plan": "^0.4.1",
"release-plan": "^0.5.1",
"typescript": "^5.1.6"
},
"publishConfig": {
Expand Down
11 changes: 8 additions & 3 deletions packages/addon-dev/src/rollup-addon-dependencies.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ const compilationModules = new Set(
templateCompilationModules.map((m) => m.module)
);

function resolvableDependencies() {
let deps = new Set();
function resolvableDependencies(): Set<string> {
let deps = new Set<string>();
let pkg = readJsonSync('package.json');
if (pkg.dependencies) {
for (let name of Object.keys(pkg.dependencies)) {
Expand All @@ -28,11 +28,16 @@ function resolvableDependencies() {
}

export default function emberExternals(): Plugin {
let deps = resolvableDependencies();
let deps: Set<string>;

return {
name: 'ember-externals',

buildStart() {
this.addWatchFile('package.json');
deps = resolvableDependencies();
},

async resolveId(source) {
let pkgName = packageName(source);
if (!pkgName) {
Expand Down
6 changes: 6 additions & 0 deletions packages/addon-dev/src/rollup-keep-assets.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,12 @@ 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 Down
7 changes: 7 additions & 0 deletions packages/addon-dev/src/rollup-public-assets.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,13 @@ export default function publicAssets(

return {
name: 'public-assets-bundler',

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

generateBundle() {
let pkg = readJsonSync('package.json');
const filenames = walkSync(path, {
Expand Down
2 changes: 2 additions & 0 deletions packages/addon-dev/src/rollup-public-entrypoints.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ 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'],
});
Expand Down
2 changes: 1 addition & 1 deletion packages/compat/src/v1-addon.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1041,7 +1041,7 @@ export default class V1Addon {
let built = new IntermediateBuild();
built.staticMeta['order-index'] = this.orderIdx;

if (this.options.lazyLoading && this.options.lazyLoading.enabled) {
if (this.options.lazyLoading === true || (this.options.lazyLoading && this.options.lazyLoading.enabled)) {
built.staticMeta['lazy-engine'] = true;
}

Expand Down
Loading

0 comments on commit 8bea275

Please sign in to comment.