Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Minor]Fix typos #1787

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Expand Up @@ -68,7 +68,7 @@ In a nutshell, the combination of webpack and `vue-loader` gives you a modern, f

Notice how the code is importing `source.vue` itself, but with different request queries for each block.

2. We want the content in `script` block to be treated like `.js` files (and if it's `<script lang="ts">`, we want to to be treated like `.ts` files). Same for other language blocks. So we want webpack to apply any configured module rules that matches `.js` also to requests that look like `source.vue?vue&type=script`. This is what `VueLoaderPlugin` (`src/plugins.ts`) does: for each module rule in the webpack config, it creates a modified clone that targets corresponding Vue language block requests.
2. We want the content in `script` block to be treated like `.js` files (and if it's `<script lang="ts">`, we want to be treated like `.ts` files). Same for other language blocks. So we want webpack to apply any configured module rules that matches `.js` also to requests that look like `source.vue?vue&type=script`. This is what `VueLoaderPlugin` (`src/plugins.ts`) does: for each module rule in the webpack config, it creates a modified clone that targets corresponding Vue language block requests.

Suppose we have configured `babel-loader` for all `*.js` files. That rule will be cloned and applied to Vue SFC `<script>` blocks as well. Internally to webpack, a request like

Expand Down
2 changes: 1 addition & 1 deletion example/webpack.config.js
Expand Up @@ -68,7 +68,7 @@ module.exports = {
}
]
},
// exmaple configration for <style lang="scss">
// example configration for <style lang="scss">
{
test: /\.scss$/,
use: [
Expand Down
2 changes: 1 addition & 1 deletion lib/loaders/pitcher.js
Expand Up @@ -163,7 +163,7 @@ module.exports.pitch = function (remainingRequest) {

// When the user defines a rule that has only resourceQuery but no test,
// both that rule and the cloned rule will match, resulting in duplicated
// loaders. Therefore it is necessary to perform a dedupe here.
// loaders. Therefore, it is necessary to perform a dedupe here.
const request = genRequest(loaders)
return `import mod from ${request}; export default mod; export * from ${request}`
}
2 changes: 1 addition & 1 deletion lib/runtime/componentNormalizer.js
Expand Up @@ -52,7 +52,7 @@ export default function normalizeComponent (
if (injectStyles) {
injectStyles.call(this, context)
}
// register component module identifier for async chunk inferrence
// register component module identifier for async chunk inference
if (context && context._registeredComponents) {
context._registeredComponents.add(moduleIdentifier)
}
Expand Down
2 changes: 1 addition & 1 deletion test/core.spec.js
Expand Up @@ -146,7 +146,7 @@ test('script import', done => {
})

// #1620
test('cloned rules should not intefere with each other', done => {
test('cloned rules should not interfere with each other', done => {
mockBundleAndRun({
entry: 'basic.vue',
module: {
Expand Down