webpack-query-creator
v1.0.1
Published
Cleanly add a query to an individual webpack loader
Downloads
5
Maintainers
Readme
#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`
}
)
],
},
],
// ...