Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.
Sign upfeat(webpack): allow function entries for `build.transpile` #6120
Conversation
This comment has been minimized.
This comment has been minimized.
This is a feat/fix by next release. Nothing will be breaking. Some other enhancements we could do is adding an option like |
This comment has been minimized.
This comment has been minimized.
codecov-io
commented
Jul 24, 2019
•
Codecov Report
@@ Coverage Diff @@
## dev #6120 +/- ##
==========================================
+ Coverage 95.75% 95.75% +<.01%
==========================================
Files 80 80
Lines 2659 2665 +6
Branches 682 686 +4
==========================================
+ Hits 2546 2552 +6
Misses 97 97
Partials 16 16
Continue to review full report at Codecov.
|
If function is one of array items, then it can only return string or regex pattern. Do you think is there any use case for multiple functions, maybe modules ? How about just making transpile: () => {
return [
'vue-test',
'@vue/test'
]
} |
if (pattern instanceof RegExp) { | ||
items.push(pattern) | ||
} else { | ||
} else if (pattern) { |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
@clarkdo Making |
This comment has been minimized.
This comment has been minimized.
Ready to review |
@@ -20,10 +20,13 @@ export default class WebpackServerConfig extends WebpackBaseConfig { | |||
const whitelist = [ | |||
/\.(?!js(x|on)?$)/i | |||
] | |||
for (const pattern of this.buildContext.buildOptions.transpile) { | |||
for (let pattern of this.buildContext.buildOptions.transpile) { |
This comment has been minimized.
This comment has been minimized.
manniL
Jul 30, 2019
Member
Looks like we have a duplicate code block here (as in src/config/base.js
, L61-70). Could we extract it somehow?
Atinux commentedJul 24, 2019
•
edited
Types of changes
Description
It's mostly a feature for module, thinking of
@nuxt/http
for example that need to addky
inbuild.transpile
but only for legacy mode.Before:
After:
The main issue I see is that module author will have to check Nuxt version to be able to push a function in😢
build.transpile
otherwise it justs breaksChecklist: