I want to force the webpack to enable specific plugin or loader for certain file/folder, multiply files. Is there a way?
You can use "include" to only include a specific folder for this rule. For example (this code only compile .ts files in /app/src folder)
{
test: /\.ts$/,
use: [
{ loader: 'react-hot-loader/webpack' },
{ loader: 'awesome-typescript-loader' }
],
include: resolve(__dirname, './../app/src')
},
More examples here: https://webpack.js.org/configuration/module/#condition
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With