Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
.prepend('.tsx')
const tsRule = config.module.rule('ts').test(/\.ts$/)
const tsxRule = config.module.rule('tsx').test(/\.tsx$/)
// add a loader to both *.ts & vue
const addLoader = ({ name, loader, options }) => {
tsRule.use(name).loader(loader).options(options)
tsxRule.use(name).loader(loader).options(options)
}
addLoader({
name: 'cache-loader',
loader: require.resolve('cache-loader'),
options: api.genCacheConfig('ts-loader', {
'ts-loader': require('ts-loader/package.json').version,
'typescript': require('typescript/package.json').version,
modern: !!process.env.VUE_CLI_MODERN_BUILD
}, 'tsconfig.json')
})
if (useThreads) {
addLoader({
name: 'thread-loader',
loader: require.resolve('thread-loader'),
options:
typeof projectOptions.parallel === 'number'
? { workers: projectOptions.parallel }
: {}
})
}
config.resolveLoader.modules.prepend(path.join(__dirname, 'node_modules'))
config.resolve
.extensions
.merge(['.ts'])
const tsRule = config.module.rule('ts').test(/\.ts$/)
const addLoader = ({ loader, options = {}}) => {
tsRule.use(loader).loader(loader).options(options)
}
addLoader({
loader: 'cache-loader',
options: api.genCacheConfig('ts-loader', {
'ts-loader': require('ts-loader/package.json').version,
'typescript': require('typescript/package.json').version,
}, 'tsconfig.json'),
})
if (useThreads) {
addLoader({
loader: 'thread-loader',
})
}
if (api.hasPlugin('babel')) {
addLoader({
loader: 'babel-loader',
})
}
addLoader({
config.resolveLoader.modules.prepend(path.join(__dirname, 'node_modules'))
config.resolve
.extensions
.merge(['.ts'])
const tsRule = config.module.rule('ts').test(/\.ts$/)
const addLoader = ({ loader, options = {} }) => {
tsRule.use(loader).loader(loader).options(options)
}
addLoader({
loader: 'cache-loader',
options: api.genCacheConfig('ts-loader', {
'ts-loader': require('ts-loader/package.json').version,
'typescript': require('typescript/package.json').version,
}, 'tsconfig.json'),
})
if (useThreads) {
addLoader({
loader: 'thread-loader',
})
}
if (api.hasPlugin('babel')) {
addLoader({
loader: 'babel-loader',
})
}
addLoader({