Commit 5cd5f6fa authored by Evan You's avatar Evan You

fix: compat with null-loader (close #1239)

parent a3af6b3a
......@@ -12,6 +12,11 @@ module.exports.pitch = function (remainingRequest) {
const query = qs.parse(this.resourceQuery.slice(1))
const loaders = this.loaders.slice(1) // remove self
// do not inject if user uses null-loader to void the type (#1239)
if (loaders.some(l => /(\/|\\)null-loader/.test(l.path))) {
return
}
// loader.request contains both the resolved loader path and its options
// query (e.g. ??ref-0)
const toLoaderString = loader => loader.request
......
......@@ -148,3 +148,17 @@ test('html-webpack-plugin', done => {
done()
}, true)
})
test('usage with null-loader', done => {
mockBundleAndRun({
entry: 'basic.vue',
modify: config => {
config.module.rules[1] = {
test: /\.css$/,
use: ['null-loader']
}
}
}, ({ window, exports, code }) => {
done()
})
})
......@@ -5781,6 +5781,10 @@ nth-check@~1.0.1:
dependencies:
boolbase "~1.0.0"
null-loader@^0.1.1:
version "0.1.1"
resolved "https://registry.yarnpkg.com/null-loader/-/null-loader-0.1.1.tgz#17be9abfcd3ff0e1512f6fc4afcb1f5039378fae"
num2fraction@^1.2.2:
version "1.2.2"
resolved "https://registry.yarnpkg.com/num2fraction/-/num2fraction-1.2.2.tgz#6f682b6a027a4e9ddfa4564cd2589d1d4e669ede"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment