nippur72/ifdef-loader

Improve documentation to include onlyCompileBundledFiles option

coreprocess opened this issue · 0 comments

The ts-loader config should include the onlyCompileBundledFiles: true option. Otherwise, files that are required to be pre-processed to be valid and are currently not imported might produce ghost errors. Adding this option will exclude these files from the build.

      {
        test: /\.ts$/,
        exclude: /node_modules/,
        use: [
          { loader: 'ts-loader', options: { onlyCompileBundledFiles: true } },
          { loader: 'ifdef-loader', options: { "ifdef-verbose": true, WEB: false, NODE: true } },
        ],
      },

It took me an hour to figure this out.

Excellent library, loving it!