Commit 61e8c073 authored by Evan You's avatar Evan You

chore: comments

parent fe153441
...@@ -46,7 +46,8 @@ module.exports = class VueLoaderPlugin { ...@@ -46,7 +46,8 @@ module.exports = class VueLoaderPlugin {
// replace the original vue rule with our new constructed rule. // replace the original vue rule with our new constructed rule.
rawRules.splice(vueRuleIndex, 1, constructedRule) rawRules.splice(vueRuleIndex, 1, constructedRule)
// inject global pitcher (responsible for injecting CSS post loader) // inject global pitcher (responsible for injecting template compiler
// loader & CSS post loader)
rawRules.unshift({ rawRules.unshift({
loader: require.resolve('./pitch') loader: require.resolve('./pitch')
}) })
......
...@@ -3,6 +3,9 @@ const postcss = require('postcss') ...@@ -3,6 +3,9 @@ const postcss = require('postcss')
const trim = require('./plugins/trim') const trim = require('./plugins/trim')
const scoped = require('./plugins/scoped') const scoped = require('./plugins/scoped')
// This is a post loader that handles scoped CSS transforms.
// Injected right before css-loader by the global pitcher (../pitch.js)
// for any <style scoped> selection requests initiated from within vue files.
module.exports = function (source, map) { module.exports = function (source, map) {
const cb = this.async() const cb = this.async()
......
...@@ -8,6 +8,10 @@ const transformAssetUrl = require('./modules/assetUrl') ...@@ -8,6 +8,10 @@ const transformAssetUrl = require('./modules/assetUrl')
const transformSrcset = require('./modules/srcset') const transformSrcset = require('./modules/srcset')
const hotReloadAPIPath = require.resolve('vue-hot-reload-api') const hotReloadAPIPath = require.resolve('vue-hot-reload-api')
// Loader that compiles raw template into JavaScript functions.
// This is injected by the global pitcher (../pitch) for template
// selection requests initiated from vue files.
// Also handles lang="xxx" pre-processing via consolidate if necessary.
module.exports = function (template) { module.exports = function (template) {
const loaderContext = this const loaderContext = this
const query = qs.parse(this.resourceQuery.slice(1)) const query = qs.parse(this.resourceQuery.slice(1))
......
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