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, {
44} ) => {
55 const useThreads = process . env . NODE_ENV === 'production' && parallel
66 const cacheDirectory = api . resolve ( 'node_modules/.cache/cache-loader' )
7+ const cliServicePath = require ( 'path' ) . dirname ( require . resolve ( '@vue/cli-service' ) )
78
89 api . chainWebpack ( webpackConfig => {
910 const jsRule = webpackConfig . module
1011 . rule ( 'js' )
1112 . test ( / \. j s x ? $ / )
1213 . exclude
1314 . 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- }
1815 // always trasnpile js in vue files
1916 if ( / \. v u e \. j s x ? $ / . test ( filepath ) ) {
2017 return false
2118 }
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+ }
2227 // Don't transpile node_modules
2328 return / n o d e _ m o d u l e s / . test ( filepath )
2429 } )
You can’t perform that action at this time.
0 commit comments