1.0.1 • Published 7 years ago

webpack-query-creator v1.0.1

Weekly downloads
2
License
ISC
Repository
github
Last release
7 years ago

#Webpack Query Creator A tool for assigning a query to a single webpack loader.

Have you encountered Error: Cannot define 'query' and multiple loaders in loaders list?

You've come to the right place!

##Usage: BEFORE: (This won't work!)

// ...

  module: {
    loaders: [
      {
        test: (absPath) => /\.tsx?$/.test(absPath),
        loaders: ['react-hot-loader/webpack', 'awesome-typescript-loader'],
        query: {
          configFileName: `${clientPath}/tsconfig.json`
        }
      },
    ],

// ...

AFTER:

import loaderWithQuery from 'webpack-query-creator'
// ...

  module: {
    loaders: [
      {
        test: (absPath) => /\.tsx?$/.test(absPath),
        loaders: [
          'react-hot-loader/webpack',
          loaderWithQuery('awesome-typescript-loader',
            {
              configFileName: `${clientPath}/tsconfig.json`
            }
          )
        ],
      },
  ],

// ...