-
Notifications
You must be signed in to change notification settings - Fork 67
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
Webpack TS Configuration Initial Implementation #2283
Webpack TS Configuration Initial Implementation #2283
Conversation
🦋 Changeset detectedLatest commit: 406fc69 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
@@ -106,7 +84,6 @@ module.exports = function createPluginConfig({ | |||
new ForkTsCheckerWebpackPlugin({ | |||
async: isEnvDevelopment, | |||
typescript: { | |||
async: isEnvDevelopment, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
webpack config type claims async isn't a property of typescript {}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Allowed properties of typescript:
memoryLimit?: number;
configFile?: string;
configOverwrite?: TypeScriptConfigOverwrite;
context?: string;
build?: boolean;
mode?: 'readonly' | 'write-tsbuildinfo' | 'write-dts' | 'write-references';
diagnosticOptions?: Partial<TypeScriptDiagnosticsOptions>;
extensions?: {
vue?: TypeScriptVueExtensionOptions;
};
profile?: boolean;
typescriptPath?: string;
I think we can put this down as a mistake until now uncaught because of lack of typings
… into webpack-ts
packages/modular-scripts/src/build-scripts/common-scripts/determineTargetPaths.ts
Show resolved
Hide resolved
packages/modular-scripts/src/build-scripts/webpack-scripts/config/getHttpsConfig.ts
Outdated
Show resolved
Hide resolved
packages/modular-scripts/src/build-scripts/webpack-scripts/config/getHttpsConfig.ts
Outdated
Show resolved
Hide resolved
packages/modular-scripts/src/build-scripts/webpack-scripts/config/modules.ts
Outdated
Show resolved
Hide resolved
packages/modular-scripts/src/build-scripts/webpack-scripts/config/modules.ts
Show resolved
Hide resolved
packages/modular-scripts/src/build-scripts/webpack-scripts/config/parts/appConfig.ts
Show resolved
Hide resolved
packages/modular-scripts/src/build-scripts/webpack-scripts/config/parts/esmViewConfig.ts
Outdated
Show resolved
Hide resolved
packages/modular-scripts/src/build-scripts/webpack-scripts/config/parts/esmViewConfig.ts
Show resolved
Hide resolved
packages/modular-scripts/src/build-scripts/webpack-scripts/config/parts/productionConfig.ts
Outdated
Show resolved
Hide resolved
packages/modular-scripts/src/build-scripts/webpack-scripts/config/webpack.config.ts
Outdated
Show resolved
Hide resolved
packages/modular-scripts/src/build-scripts/webpack-scripts/config/webpack.config.ts
Outdated
Show resolved
Hide resolved
packages/modular-scripts/src/build-scripts/webpack-scripts/config/webpackDevServer.config.ts
Outdated
Show resolved
Hide resolved
const isEsmView = isModularType(targetPath, 'esm-view'); | ||
const isView = isModularType(targetPath, 'view'); | ||
if (isView) { | ||
targetPath = stageView(target); | ||
paths = determineTargetPaths(target, targetPath); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
paths = determineTargetPaths(target, targetPath);
in the if branch is repeated in the else branch. Maybe it just needs to be outside the if?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
targetPath is updated in one of the two if branches, thus changing the output of determine target branches
It was actually a bug that I took a long time to figure out
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see. We'll need to disentangle this code, but not for now. Can you put a //TODO: this needs to be rewritten in a clearer way
or something equivalent?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Now that I've revisited it I cleaned it up
…based modular start: fix and enhance https support in esbuild mode (rebased)
Background
Webpack now supports configuration written in TypeScript.
Currently, modular-scripts has two folders of JS code copied over from CRA, adapted as needed, to create the Webpack configuration for Modular. Modular's build and start script run JS scripts with execa() to start and build with Webpack.
Problems:
This PR
We now create the Webpack configuration in TypeScript, and run the build and start scripts as functions, passing variables directly.
To Do:
public/index.html
for esm-views #2282There's still a lot of work to be done in future PRs:
Few notes for those reviewing this PR:
Things have been moved around so much that a lot of code appears as 'new', while in fact it's just moved/typed but using existing logic. I've held back from making actual functional code changes to existing scripts unless absolutely necessary.