-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Use webpack instead of tsc to output extension-api.ts #1499
Conversation
Can't get what this PR fixing / improves? |
|
Ok, @chenhunghan please put next time relevant links in PR/issue description. |
sure, it's a WIP draft so I didn't put too much attention on the description. |
@jakolehm checks are passed, please take a look |
Signed-off-by: Hung-Han (Henry) Chen <1474479+chenhunghan@users.noreply.github.com>
Signed-off-by: Hung-Han (Henry) Chen <1474479+chenhunghan@users.noreply.github.com>
…tensions Signed-off-by: Hung-Han (Henry) Chen <1474479+chenhunghan@users.noreply.github.com>
Signed-off-by: Hung-Han (Henry) Chen <1474479+chenhunghan@users.noreply.github.com>
Signed-off-by: Hung-Han (Henry) Chen <1474479+chenhunghan@users.noreply.github.com>
f36ba40
to
c2e23bd
Compare
extensions: ['.ts', '.tsx', '.js'] | ||
}, | ||
plugins: [ | ||
// In ts-loader's README they said to output a built .d.ts file, |
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.
Should we remove these?
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 prefer to leave it there as someone else might waste time trying...
The original script
compile:extension-types
(introduced in #1387) which usestsc
to output.d.ts
didn't (completely) resolve issue #1262, becausetsc
only transpile.ts/tsx
to.js
The
require('module')/import
ints/tsx
are the same after transpilation. Keepingrequire/import
causes lensapp/generator-lens-ext#13 (see comments) for extension developers, when they try to import modules from@k8slens/extensions
The PR aims to use WebPack to solve the problem. I added a new
webpack.extensions.ts
, and usedwebpack
+ts-loader
to pack@k8slens/extensions
as one fileextension-api.js
and output.d.ts
just the same originaltsc
.I tried to keep
webpack.extensions.ts
as simple as possible, so remove unnecessary settings which are in other more complicated settings such aswebpack.renderer.ts
orwebpack.main.ts
Closes #1262
Signed-off-by: Hung-Han (Henry) Chen 1474479+chenhunghan@users.noreply.github.com