Webpack Exclude a specific file

后端 未结 2 1966
一整个雨季
一整个雨季 2020-11-30 10:54

I have this code In my webpack.config.prod.js and I was wondering how do I exclude all json except one in a specific path like src/configs/configs<

2条回答
  •  Happy的楠姐
    2020-11-30 11:33

    According to the Webpack documentation, you can do something like this.

    exclude: {
      test: [
        /\.html$/,
        /\.(js|jsx)$/,
        /\.css$/,
        /\.json$/,
        /\.bmp$/,
        /\.gif$/,
        /\.jpe?g$/,
        /\.png$/,
      ],
      exclude: [
        'src/configs/configs/your.json'
      ]
    }
    

提交回复
热议问题