File tree Expand file tree Collapse file tree 1 file changed +9
-4
lines changed
packages/@vue/cli-plugin-babel Expand file tree Collapse file tree 1 file changed +9
-4
lines changed Original file line number Diff line number Diff line change @@ -4,21 +4,26 @@ module.exports = (api, {
4
4
} ) => {
5
5
const useThreads = process . env . NODE_ENV === 'production' && parallel
6
6
const cacheDirectory = api . resolve ( 'node_modules/.cache/cache-loader' )
7
+ const cliServicePath = require ( 'path' ) . dirname ( require . resolve ( '@vue/cli-service' ) )
7
8
8
9
api . chainWebpack ( webpackConfig => {
9
10
const jsRule = webpackConfig . module
10
11
. rule ( 'js' )
11
12
. test ( / \. j s x ? $ / )
12
13
. exclude
13
14
. add ( filepath => {
14
- // check if this is something the user explicitly wants to transpile
15
- if ( transpileDependencies . some ( dep => filepath . match ( dep ) ) ) {
16
- return false
17
- }
18
15
// always trasnpile js in vue files
19
16
if ( / \. v u e \. j s x ? $ / . test ( filepath ) ) {
20
17
return false
21
18
}
19
+ // exclude dynamic entries from cli-service
20
+ if ( filepath . startsWith ( cliServicePath ) ) {
21
+ return true
22
+ }
23
+ // check if this is something the user explicitly wants to transpile
24
+ if ( transpileDependencies . some ( dep => filepath . match ( dep ) ) ) {
25
+ return false
26
+ }
22
27
// Don't transpile node_modules
23
28
return / n o d e _ m o d u l e s / . test ( filepath )
24
29
} )
You can’t perform that action at this time.
0 commit comments