mirror of
https://github.com/vuejs/vue-cli.git
synced 2026-04-22 12:28:44 -05:00
test: fix exclude for cli-service dynamic entries
This commit is contained in:
@@ -4,6 +4,7 @@ module.exports = (api, {
|
||||
}) => {
|
||||
const useThreads = process.env.NODE_ENV === 'production' && parallel
|
||||
const cacheDirectory = api.resolve('node_modules/.cache/cache-loader')
|
||||
const cliServicePath = require('path').dirname(require.resolve('@vue/cli-service'))
|
||||
|
||||
api.chainWebpack(webpackConfig => {
|
||||
const jsRule = webpackConfig.module
|
||||
@@ -11,14 +12,18 @@ module.exports = (api, {
|
||||
.test(/\.jsx?$/)
|
||||
.exclude
|
||||
.add(filepath => {
|
||||
// check if this is something the user explicitly wants to transpile
|
||||
if (transpileDependencies.some(dep => filepath.match(dep))) {
|
||||
return false
|
||||
}
|
||||
// always trasnpile js in vue files
|
||||
if (/\.vue\.jsx?$/.test(filepath)) {
|
||||
return false
|
||||
}
|
||||
// exclude dynamic entries from cli-service
|
||||
if (filepath.startsWith(cliServicePath)) {
|
||||
return true
|
||||
}
|
||||
// check if this is something the user explicitly wants to transpile
|
||||
if (transpileDependencies.some(dep => filepath.match(dep))) {
|
||||
return false
|
||||
}
|
||||
// Don't transpile node_modules
|
||||
return /node_modules/.test(filepath)
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user