//file config.js ,该loader忽略*.ts里的内容
export default {
plugins,
hash: true,
targets: {
ie: 11,
},
urlLoaderExcludes: [/\.ts$/],
chainWebpack(config) {
config.module.rule('ignore-ts-file')
.test(/\.ts$/)
.use(require.resolve('../loaders/ignore-loader'))
.loader(require.resolve('../loaders/ignore-loader'))
},
...
//file :loaders/ignore-loader
module.exports = function(content) {
//this.cacheable && this.cacheable();
console.log("statring ignore loader")
return '';
}