vuetify-loader
Advanced tools
Comparing version 1.7.2 to 1.7.3
@@ -91,3 +91,3 @@ var path = require('path') | ||
if (isProd) { | ||
module.exports.devtool = '#source-map' | ||
module.exports.devtool = 'source-map' | ||
// http://vue-loader.vuejs.org/en/workflow/production.html | ||
@@ -94,0 +94,0 @@ module.exports.plugins = (module.exports.plugins || []).concat([ |
@@ -1,4 +0,1 @@ | ||
const webpack = require('webpack') | ||
let vueLoaderPath | ||
@@ -21,7 +18,8 @@ try { | ||
// Naive approach without RuleSet or RuleSetCompiler | ||
rules.map((rule, i) => rule.use && rule.use.find(isVueLoader) ? i : null).filter(v => v != null) | ||
// find the rules that apply to vue files | ||
return rules.filter(rule => rule.use && rule.use.find(isVueLoader)) | ||
return rules.map((rule, index) => ( | ||
rule.use && rule.use.find && rule.use.find(isVueLoader) | ||
? { rule: { ...rule }, index } | ||
: null | ||
)).filter(v => v != null) | ||
} | ||
} |
@@ -23,2 +23,8 @@ const url = require('url') | ||
const rules = [...compiler.options.module.rules] | ||
vueRules.forEach(({ rule, index }) => { | ||
rules[index] = rule | ||
}) | ||
compiler.options.module.rules = rules | ||
if (this.options.progressiveImages) { | ||
@@ -38,6 +44,14 @@ const options = typeof this.options.progressiveImages === 'boolean' | ||
) { | ||
module.loaders.unshift({ | ||
loader: require.resolve('vuetify-loader/progressive-loader'), | ||
options | ||
}) | ||
if (/^asset\/?/.test(module.type)) { | ||
compilation.errors.push(new Error( | ||
'vuetify-loader: progressiveImages does not work with asset modules, use file-loader or url-loader\n' + | ||
`"${module.rawRequest}" will be loaded normally\n` + | ||
'See https://webpack.js.org/guides/asset-modules/' | ||
)) | ||
} else { | ||
module.loaders.unshift({ | ||
loader: require.resolve('vuetify-loader/progressive-loader'), | ||
options | ||
}) | ||
} | ||
} | ||
@@ -49,3 +63,3 @@ }) | ||
updateVueRule (rule) { | ||
updateVueRule ({ rule }) { | ||
if (this.options.progressiveImages) { | ||
@@ -52,0 +66,0 @@ const vueLoaderOptions = rule.use.find(isVueLoader).options |
{ | ||
"name": "vuetify-loader", | ||
"version": "1.7.2", | ||
"version": "1.7.3", | ||
"description": "A Webpack plugin for treeshaking Vuetify components and more", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
39559
689