Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build: less noise when compiling #19808

Merged
merged 1 commit into from
Nov 11, 2022
Merged

Conversation

ndelangen
Copy link
Member

Issue:

What I did

How to test

  • Is this testable with Jest or Chromatic screenshots?
  • Does this need a new example in the kitchen sink apps?
  • Does this need an update to the documentation?

If your answer is yes to any of these, please make sure to include it in your PR.

@ndelangen ndelangen self-assigned this Nov 11, 2022
Comment on lines -35 to -58
if (!optimized) {
await Promise.all(
entries.map(async (file: string) => {
console.log(`skipping generating types for ${file}`);
const { name: entryName, dir } = path.parse(file);

const pathName = join(process.cwd(), dir.replace('./src', 'dist'), `${entryName}.d.ts`);
const srcName = join(process.cwd(), file);

const rel = relative(dirname(pathName), dirname(srcName))
.split(path.sep)
.join(path.posix.sep);

await fs.ensureFile(pathName);
await fs.writeFile(
pathName,
dedent`
// devmode
export * from '${rel}/${entryName}';
`
);
})
);
}
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Moving this should get a little speed increase, since we're not waiting for this to complete before starting the esbuild builds.

build({
silent: true,
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Making it silent, will only output errors

@ndelangen ndelangen added the build Internal-facing build tooling & test updates label Nov 11, 2022
Comment on lines -91 to -101
c.define = optimized
? {
'process.env.NODE_ENV': "'production'",
'process.env': '{}',
global: 'window',
}
: {
'process.env.NODE_ENV': "'development'",
'process.env': '{}',
global: 'window',
};
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have a suspicion that this is not required anymore

entry: entries.map((e: string) => slash(join(cwd, e))),
watch,
...(tsConfigExists ? { tsconfig: tsConfigPath } : {}),
outDir: join(process.cwd(), 'dist'),
// sourcemap: optimized,
format: ['esm'],
target: 'chrome100',
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JReinhold you mentioned that we might want to add a FireFix version in here?
What do you think that version should be?

Copy link
Contributor

@JReinhold JReinhold Nov 11, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Based on browserslist defaults and Can I Use usage table I'd suggest this:

Suggested change
target: 'chrome100',
target: ['chrome105', 'safari15', 'firefox105'],

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FWIW, our migration guide indicates chrome 100+, if we change this, we would probably need to update that doc as well.

@ndelangen ndelangen merged commit ac24e0b into next Nov 11, 2022
@ndelangen ndelangen deleted the tech/no-more-esbuild-define branch November 11, 2022 18:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
build Internal-facing build tooling & test updates
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants