File tree 1 file changed +16
-4
lines changed
packages/@vuepress/core/lib/node/webpack
1 file changed +16
-4
lines changed Original file line number Diff line number Diff line change @@ -137,22 +137,30 @@ module.exports = function createBaseConfig (context, isServer) {
137
137
. rule ( 'js' )
138
138
. test ( / \. j s x ? $ / )
139
139
. exclude . add ( filePath => {
140
- // Always transpile lib directory
140
+ // transpile lib directory
141
141
if ( filePath . startsWith ( libDir ) ) {
142
142
return false
143
143
}
144
- // always transpile js in vue files and md files
144
+
145
+ // transpile js in vue files and md files
145
146
if ( / \. ( v u e | m d ) \. j s $ / . test ( filePath ) ) {
146
147
return false
147
148
}
149
+
148
150
// transpile all core packages and vuepress related packages.
149
151
// i.e.
150
152
// @vuepress /*
151
153
// vuepress-*
152
154
if ( / ( @ v u e p r e s s [ \/ \\ ] [ ^ \/ \\ ] * | v u e p r e s s - [ ^ \/ \\ ] * ) [ \/ \\ ] (? ! n o d e _ m o d u l e s ) .* \. j s $ / . test ( filePath ) ) {
153
155
return false
154
156
}
155
- // Don't transpile node_modules
157
+
158
+ // transpile @babel /runtime until fix for babel/babel#7597 is released
159
+ if ( filePath . includes ( path . join ( '@babel' , 'runtime' ) ) ) {
160
+ return false
161
+ }
162
+
163
+ // don't transpile node_modules
156
164
return / n o d e _ m o d u l e s / . test ( filePath )
157
165
} ) . end ( )
158
166
. use ( 'cache-loader' )
@@ -171,7 +179,11 @@ module.exports = function createBaseConfig (context, isServer) {
171
179
// ref: http://babeljs.io/docs/en/config-files
172
180
configFile : false ,
173
181
presets : [
174
- require . resolve ( '@vue/babel-preset-app' )
182
+ [ require . resolve ( '@vue/babel-preset-app' ) , {
183
+ entryFiles : [
184
+ path . resolve ( __dirname , '../../client' , isServer ? 'serverEntry.js' : 'clientEntry.js' )
185
+ ]
186
+ } ]
175
187
]
176
188
} )
177
189
}
You can’t perform that action at this time.
0 commit comments