diff --git a/.babelrc b/.babelrc
deleted file mode 100644
index 3ed94dff9..000000000
--- a/.babelrc
+++ /dev/null
@@ -1,5 +0,0 @@
-{
- "presets": [
- ["env", { "modules": false }]
- ]
-}
diff --git a/.eslintrc b/.eslintrc
new file mode 100644
index 000000000..fd0128479
--- /dev/null
+++ b/.eslintrc
@@ -0,0 +1,162 @@
+{
+ "env": {
+ "browser": true,
+ "node": true
+ },
+
+ "rules": {
+ "accessor-pairs": 2,
+ "array-bracket-spacing": 0,
+ "block-scoped-var": 0,
+ "brace-style": [2, "1tbs", { "allowSingleLine": true }],
+ "camelcase": 0,
+ "comma-dangle": [2, "never"],
+ "comma-spacing": [2, { "before": false, "after": true }],
+ "comma-style": [2, "last"],
+ "complexity": 0,
+ "computed-property-spacing": 0,
+ "consistent-return": 0,
+ "consistent-this": 0,
+ "constructor-super": 2,
+ "curly": [2, "multi-line"],
+ "default-case": 0,
+ "dot-location": [2, "property"],
+ "dot-notation": 0,
+ "eol-last": 2,
+ "eqeqeq": [2, "allow-null"],
+ "func-names": 0,
+ "func-style": 0,
+ "generator-star-spacing": [2, { "before": true, "after": true }],
+ "guard-for-in": 0,
+ "handle-callback-err": [2, "^(err|error)$" ],
+ "indent": [2, 2, { "SwitchCase": 1 }],
+ "key-spacing": [2, { "beforeColon": false, "afterColon": true }],
+ "linebreak-style": 0,
+ "lines-around-comment": 0,
+ "max-nested-callbacks": 0,
+ "new-cap": [2, { "newIsCap": true, "capIsNew": false }],
+ "new-parens": 2,
+ "newline-after-var": 0,
+ "no-alert": 0,
+ "no-array-constructor": 2,
+ "no-caller": 2,
+ "no-catch-shadow": 0,
+ "no-cond-assign": 2,
+ "no-console": 0,
+ "no-constant-condition": 0,
+ "no-continue": 0,
+ "no-control-regex": 2,
+ "no-debugger": 2,
+ "no-delete-var": 2,
+ "no-div-regex": 0,
+ "no-dupe-args": 2,
+ "no-dupe-keys": 2,
+ "no-duplicate-case": 2,
+ "no-else-return": 0,
+ "no-empty": 0,
+ "no-empty-character-class": 2,
+ "no-empty-label": 2,
+ "no-eq-null": 0,
+ "no-eval": 2,
+ "no-ex-assign": 2,
+ "no-extend-native": 2,
+ "no-extra-bind": 2,
+ "no-extra-boolean-cast": 2,
+ "no-extra-parens": 0,
+ "no-extra-semi": 0,
+ "no-fallthrough": 2,
+ "no-floating-decimal": 2,
+ "no-func-assign": 2,
+ "no-implied-eval": 2,
+ "no-inline-comments": 0,
+ "no-inner-declarations": [2, "functions"],
+ "no-invalid-regexp": 2,
+ "no-irregular-whitespace": 2,
+ "no-iterator": 2,
+ "no-label-var": 2,
+ "no-labels": 2,
+ "no-lone-blocks": 2,
+ "no-lonely-if": 0,
+ "no-loop-func": 0,
+ "no-mixed-requires": 0,
+ "no-mixed-spaces-and-tabs": 2,
+ "no-multi-spaces": 2,
+ "no-multi-str": 2,
+ "no-multiple-empty-lines": [2, { "max": 1 }],
+ "no-native-reassign": 2,
+ "no-negated-in-lhs": 2,
+ "no-nested-ternary": 0,
+ "no-new": 2,
+ "no-new-func": 0,
+ "no-new-object": 2,
+ "no-new-require": 2,
+ "no-new-wrappers": 2,
+ "no-obj-calls": 2,
+ "no-octal": 2,
+ "no-octal-escape": 2,
+ "no-param-reassign": 0,
+ "no-path-concat": 0,
+ "no-process-env": 0,
+ "no-process-exit": 0,
+ "no-proto": 0,
+ "no-redeclare": 2,
+ "no-regex-spaces": 2,
+ "no-restricted-modules": 0,
+ "no-return-assign": 2,
+ "no-script-url": 0,
+ "no-self-compare": 2,
+ "no-sequences": 2,
+ "no-shadow": 0,
+ "no-shadow-restricted-names": 2,
+ "no-spaced-func": 2,
+ "no-sparse-arrays": 2,
+ "no-sync": 0,
+ "no-ternary": 0,
+ "no-this-before-super": 2,
+ "no-throw-literal": 2,
+ "no-trailing-spaces": 2,
+ "no-undef": 2,
+ "no-undef-init": 2,
+ "no-undefined": 0,
+ "no-underscore-dangle": 0,
+ "no-unexpected-multiline": 2,
+ "no-unneeded-ternary": 2,
+ "no-unreachable": 2,
+ "no-unused-expressions": 0,
+ "no-unused-vars": [2, { "vars": "all", "args": "none" }],
+ "no-use-before-define": 0,
+ "no-var": 0,
+ "no-void": 0,
+ "no-warning-comments": 0,
+ "no-with": 2,
+ "object-curly-spacing": 0,
+ "object-shorthand": 0,
+ "one-var": [2, { "initialized": "never" }],
+ "operator-assignment": 0,
+ "operator-linebreak": [2, "after", { "overrides": { "?": "before", ":": "before" } }],
+ "padded-blocks": 0,
+ "prefer-const": 0,
+ "quote-props": 0,
+ "quotes": [2, "single", "avoid-escape"],
+ "radix": 2,
+ "semi": [2, "never"],
+ "semi-spacing": 0,
+ "sort-vars": 0,
+ "space-after-keywords": [2, "always"],
+ "space-before-blocks": [2, "always"],
+ "space-before-function-paren": [2, "always"],
+ "space-in-parens": [2, "never"],
+ "space-infix-ops": 2,
+ "space-return-throw-case": 2,
+ "space-unary-ops": [2, { "words": true, "nonwords": false }],
+ "spaced-comment": [2, "always", { "markers": ["global", "globals", "eslint", "eslint-disable", "*package", "!"] }],
+ "strict": 0,
+ "use-isnan": 2,
+ "valid-jsdoc": 0,
+ "valid-typeof": 2,
+ "vars-on-top": 0,
+ "wrap-iife": [2, "any"],
+ "wrap-regex": 0,
+ "yoda": [2, "never"]
+ }
+}
diff --git a/.eslintrc.js b/.eslintrc.js
deleted file mode 100644
index b31f02096..000000000
--- a/.eslintrc.js
+++ /dev/null
@@ -1,8 +0,0 @@
-module.exports = {
- root: true,
- extends: ['plugin:vue-libs/recommended'],
- rules: {
- indent: 'off',
- 'space-before-function-paren': 'off'
- }
-}
diff --git a/.gitattributes b/.gitattributes
deleted file mode 100644
index 6313b56c5..000000000
--- a/.gitattributes
+++ /dev/null
@@ -1 +0,0 @@
-* text=auto eol=lf
diff --git a/.github/ISSUE_TEMPLATE.md b/.github/ISSUE_TEMPLATE.md
deleted file mode 100644
index bd0e4f286..000000000
--- a/.github/ISSUE_TEMPLATE.md
+++ /dev/null
@@ -1,7 +0,0 @@
-
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
deleted file mode 100644
index 0a3ad19f4..000000000
--- a/.github/workflows/ci.yml
+++ /dev/null
@@ -1,46 +0,0 @@
-name: 'ci'
-on:
- push:
- branches:
- - master
- pull_request:
- branches:
- - master
-jobs:
- unit-test:
- runs-on: ${{ matrix.os }}
- strategy:
- matrix:
- os:
- - ubuntu-latest
- - macos-latest
- - windows-latest
- fail-fast: false
- name: "Unit Test: ${{ matrix.os }}"
- steps:
- - uses: actions/checkout@v2
-
- - name: Install pnpm
- uses: pnpm/action-setup@v2
- with:
- version: 8
-
- - name: Set node version to 16
- uses: actions/setup-node@v2
- with:
- node-version: 16
- cache: 'pnpm'
-
- - run: pnpm install
-
- - name: Run unit tests
- run: pnpm run test
-
- - name: Set up webpack 5 tests
- run: npx json -f package.json -I -e "this.resolutions = {}, this.resolutions.webpack = '^5.0.0', this.devDependencies.webpack = '^5.0.0' "
-
- - name: Install webpack 5
- run: pnpm install --no-frozen-lockfile
-
- - name: Run unit tests for webpack 5
- run: pnpm run test && pnpm run test:match-resource
diff --git a/.gitignore b/.gitignore
index 914a2dab2..6c2848eb9 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,10 +1,5 @@
-.idea
-.DS_Store
-exploration
node_modules
-*.log
-example/dist
-docs/.vuepress/dist
-test/.cache
-.vscode
-TODOS
+npm-debug.log
+test/output
+docs/_book
+.DS_Store
diff --git a/.npmignore b/.npmignore
deleted file mode 100644
index 6e52da593..000000000
--- a/.npmignore
+++ /dev/null
@@ -1,10 +0,0 @@
-example
-test
-*.yml
-*.log
-yarn.lock
-tsconfig.json
-docs
-.github
-.vscode
-TODOS
diff --git a/CHANGELOG.md b/CHANGELOG.md
deleted file mode 100644
index 4b1b4d60d..000000000
--- a/CHANGELOG.md
+++ /dev/null
@@ -1,762 +0,0 @@
-
-# [15.11.1](https://github.com/vuejs/vue-loader/compare/v15.11.0...v15.11.1) (2023-10-18)
-
-### Bug Fixes
-
-* fix: fix read property error for accessing lang of script ([#2060](https://github.com/vuejs/vue-loader/pull/2060))
-
-
-
-# [15.11.0](https://github.com/vuejs/vue-loader/compare/v15.10.2...v15.11.0) (2023-10-18)
-
-### Features
-
-* A new `experimentalInlineMatchResource` option (webpack 5 only), which leverages webpack 5's [inline matchResource](https://webpack.js.org/api/loaders/#inline-matchresource) feature in the underlying implementation, and works well with the [`experiments.css`](https://webpack.js.org/configuration/experiments/#experimentscss) feature. This also makes `vue-loader` compatible with [Rspack](https://www.rspack.dev/guide/vue). ([#2058](https://github.com/vuejs/vue-loader/pull/2058))
-
-
-
-# [15.10.2](https://github.com/vuejs/vue-loader/compare/v15.10.1...v15.10.2) (2023-08-23)
-
-### Bug Fixes
-
-* don't enable prettify by default if prettier 3 is detected ([aa2558d](https://github.com/vuejs/vue-loader/commit/aa2558d))
-
-
-
-# [15.10.1](https://github.com/vuejs/vue-loader/compare/v15.10.0...v15.10.1) (2022-11-14)
-
-### Bug Fixes
-
-* skip thread-loader when cloning js rules to template compilation pipeline, fixes ([fb6ff6e](https://github.com/vuejs/vue-loader/commit/fb6ff6e))
-
-
-
-# [15.10.0](https://github.com/vuejs/vue-loader/compare/v15.10.0-beta.6...v15.10.0) (2022-07-01)
-
-
-
-
-# [15.10.0-beta.6](https://github.com/vuejs/vue-loader/compare/v15.10.0-beta.5...v15.10.0-beta.6) (2022-06-20)
-
-
-### Bug Fixes
-
-* always pass id to stylePostLoader when possible ([364ad09](https://github.com/vuejs/vue-loader/commit/364ad09))
-
-
-
-
-# [15.10.0-beta.5](https://github.com/vuejs/vue-loader/compare/v15.10.0-beta.4...v15.10.0-beta.5) (2022-06-20)
-
-
-### Bug Fixes
-
-* css v-bind in production mode ([655e5f8](https://github.com/vuejs/vue-loader/commit/655e5f8))
-
-
-
-
-# [15.10.0-beta.4](https://github.com/vuejs/vue-loader/compare/v15.10.0-beta.3...v15.10.0-beta.4) (2022-06-20)
-
-
-### Features
-
-* support css v-bind (requires 2.7.0-beta.3) ([d653f3b](https://github.com/vuejs/vue-loader/commit/d653f3b))
-
-
-
-
-# [15.10.0-beta.3](https://github.com/vuejs/vue-loader/compare/v15.10.0-beta.2...v15.10.0-beta.3) (2022-06-16)
-
-
-### Bug Fixes
-
-* cache descriptor with correct resource path ([f6c83b5](https://github.com/vuejs/vue-loader/commit/f6c83b5))
-
-
-
-
-# [15.10.0-beta.2](https://github.com/vuejs/vue-loader/compare/v15.10.0-beta.1...v15.10.0-beta.2) (2022-06-16)
-
-
-### Features
-
-* use script-analyzed bindings when compiling template ([55de28c](https://github.com/vuejs/vue-loader/commit/55de28c))
-
-
-
-
-# [15.10.0-beta.1](https://github.com/vuejs/vue-loader/compare/v15.9.8...v15.10.0-beta.1) (2022-06-14)
-
-
-### Features
-
-* apply js loaders to compiled template code when used with 2.7 ([30464a8](https://github.com/vuejs/vue-loader/commit/30464a8))
-* compat for vue 2.7, support `
-
-
-```
-
-There are many cool features provided by `vue-loader`:
-
-- Allows using other webpack loaders for each part of a Vue component, for example Sass for `
-```
+### What is `vue-loader`?
+
+`vue-loader` is a loader for Webpack that can transform Vue components written in the following format into a plain JavaScript module:
+
+
There are many cool features provided by `vue-loader`:
-- Allows using other webpack loaders for each part of a Vue component, for example Sass for `
+```
+
+Under the hood, the text content inside the `
+```
+
+However, note this makes your Vue component Webpack-specific and not compatible with Browserify and [vueify](https://github.com/vuejs/vueify). **If you intend to ship your Vue component as a reusable 3rd-party component, avoid using this syntax.**
diff --git a/docs/deploy.sh b/docs/deploy.sh
new file mode 100644
index 000000000..1242aaf57
--- /dev/null
+++ b/docs/deploy.sh
@@ -0,0 +1,10 @@
+cd docs
+rm -rf _book
+gitbook build
+cp assets/circle.yml _book/circle.yml
+cp assets/CNAME _book/CNAME
+cd _book
+git init
+git add -A
+git commit -m 'update book'
+git push -f git@github.com:vuejs/vue-loader.git master:gh-pages
diff --git a/docs/features/es2015.md b/docs/features/es2015.md
new file mode 100644
index 000000000..dae2dd4f8
--- /dev/null
+++ b/docs/features/es2015.md
@@ -0,0 +1,92 @@
+# ES2015 and Babel Configuration
+
+`vue-loader` ships with ES2015 (aka ES6) enabled by default in `
+```
+
+We are using ES2015's Object literal shorthand here to define the child components. `{ ComponentA }` is simply shorthand for `{ ComponentA: ComponentA }`. Vue will automatically convert the key to `component-a`, so you can use the imported component in the template as ``.
+
+### Using Custom Babel Configuration
+
+> **Compatibility Note**: `vue-loader` 7.0+ uses Babel 6. If you need to use Babel 5 for transpiling your code, use vue-loader 6.x.
+
+The default Babel options used for scripts inside Vue components are:
+
+``` json
+{
+ "presets": ["es2015"],
+ "plugins": ["transform-runtime"]
+}
+```
+
+If you want to use custom presets or plugins, for example, to enable stage-0 language features, install the preset/plugin and then add a `babel` field in your Webpack config:
+
+``` bash
+npm install babel-preset-stage-0 --save-dev
+```
+
+``` js
+// webpack.config.js
+module.exports = {
+ // other configs...
+ babel: {
+ // enable stage 0 babel transforms.
+ presets: ['es2015', 'stage-0'],
+ plugins: ['transform-runtime']
+ }
+}
+```
+
+Alternatively, you can add a `.babelrc` file at the root of your project.
+
+### Compiling `.js` Files with Babel
+
+Since we are already using Babel, most likely you'll want to compile your normal `.js` files too! Here's how to do it in your Webpack config:
+
+``` js
+// webpack.config.js
+module.exports = {
+ // other options ...
+ module: {
+ loaders: [
+ {
+ // use vue-loader for *.vue files
+ test: /\.vue$/,
+ loader: 'vue'
+ },
+ {
+ // use babel-loader for *.js files
+ test: /\.js$/,
+ loader: 'babel',
+ // important: exclude files in node_modules
+ // otherwise it's going to be really slow!
+ exclude: /node_modules/
+ }
+ ]
+ },
+ // if you are using babel-loader directly then
+ // the babel config block becomes required.
+ babel: {
+ presets: ['es2015'],
+ plugins: ['transform-runtime']
+ }
+}
+```
diff --git a/docs/features/hot-reload.md b/docs/features/hot-reload.md
new file mode 100644
index 000000000..57672d606
--- /dev/null
+++ b/docs/features/hot-reload.md
@@ -0,0 +1,42 @@
+# Hot Reload
+
+"Hot Reload" is not simply reloading the page when you edit a file. With hot reload enabled, when you edit a `*.vue` file, all instances of that component will be swapped in **without reloading the page**. It even preserves the current state of your app and these swapped components! This dramatically improves the development experience when you are tweaking the templates or styling of your components.
+
+
+
+### Enabling Hot Reload
+
+The easiest setup for enabling hot reload is what we outlined in the [basic tutorial](../start/tutorial.md):
+
+``` js
+// package.json
+...
+"scripts": {
+ "dev": "webpack-dev-server --inline --hot"
+}
+...
+```
+
+This is assuming that you are serving the same `index.html` from the root of your project. By default, Webpack dev server uses the current working directory as its content base and serves all static files in the directory.
+
+Run `npm run dev` and the static app will be served at `http://localhost:8080`.
+
+### Hot Reload Notes
+
+- When a component is hot-reloaded, its current state is preserved. However, the component itself is destroyed and recreated, so all of its lifecycle hooks will be called accordingly. Make sure to properly teardown any side effects in your lifecycle hooks.
+
+- Private state for child components of a hot-reloaded component is not guaranteed to be preserved across reloads.
+
+- A root Vue instance or a manually mounted instance cannot be hot-reloaded. It will always force a full reload.
+
+### Configuration Tips
+
+- You can use the `--port` option to serve at a different port.
+
+- If your file structure is different, you will have to configure `output.publicPath` in your Webpack config and the `--content-base` option of your webpack-dev-server command accordingly.
+
+- If you are using the HTML5 history API (for example with `vue-router`), you will also want to add the `--history-api-fallback` option.
+
+- Consult the [Webpack dev server documentation](https://webpack.github.io/docs/webpack-dev-server.html) for advanced topics such as combining the dev server with another backend server.
+
+- Finally, if you have an existing [Express](http://expressjs.com/en/index.html) based Node.js backend, you can just add the [Webpack dev middleware](https://webpack.github.io/docs/webpack-dev-middleware.html) to serve your webpack bundle.
diff --git a/docs/features/postcss.md b/docs/features/postcss.md
new file mode 100644
index 000000000..487b9e71f
--- /dev/null
+++ b/docs/features/postcss.md
@@ -0,0 +1,49 @@
+# PostCSS and Autoprefixer
+
+Any CSS output processed by `vue-loader` is piped through [PostCSS](https://github.com/postcss/postcss) for scoped CSS rewriting and auto-prefixed by default using [autoprefixer](https://github.com/postcss/autoprefixer).
+
+### Configuring Autoprefixer
+
+You can configure autoprefixer using the `autoprefixer` option under the `vue` section of your webpack config. See possible [autoprefixer options](https://github.com/postcss/autoprefixer#options). Also, you can pass in `false` to disable autoprefixing.
+
+Example:
+
+``` js
+// webpack.config.js
+module.exports = {
+ // other options...
+ module: {
+ loaders: [
+ {
+ test: /\.vue$/,
+ loader: 'vue'
+ }
+ ]
+ },
+ // vue-loader configurations
+ vue: {
+ // configure autoprefixer
+ autoprefixer: {
+ browsers: ['last 2 versions']
+ }
+ }
+}
+```
+
+### Using Custom PostCSS Plugins
+
+To use custom PostCSS pugins, pass an array to the `postcss` option under the `vue` section. Example using [CSSNext](http://cssnext.io/):
+
+``` js
+// webpack.config.js
+module.exports = {
+ // other configs...
+ vue: {
+ // use custom postcss plugins
+ postcss: [require('postcss-cssnext')()],
+ // disable vue-loader autoprefixing.
+ // this is a good idea since cssnext comes with it too.
+ autoprefixer: false
+ }
+}
+```
diff --git a/docs/features/scoped-css.md b/docs/features/scoped-css.md
new file mode 100644
index 000000000..96bd72874
--- /dev/null
+++ b/docs/features/scoped-css.md
@@ -0,0 +1,49 @@
+# Scoped CSS
+
+When a `
+
+
+
hi
+
+```
+
+Into the following:
+
+``` html
+
+
+
+
hi
+
+```
+
+#### Notes
+
+1. You can include both scoped and non-scoped styles in the same component:
+
+ ``` html
+
+
+
+ ```
+
+2. A child component's root node will be affected by both the parent's scoped CSS and the child's scoped CSS.
+
+3. Partials are not affected by scoped styles.
+
+4. **Be careful with descendant selectors in recursive components!** For a CSS rule with the selector `.a .b`, if the element that matches `.a` contains a recursive child component, then all `.b` in that child component will be matched by the rule.
diff --git a/docs/getting-started.md b/docs/getting-started.md
new file mode 100644
index 000000000..beac721df
--- /dev/null
+++ b/docs/getting-started.md
@@ -0,0 +1,176 @@
+# Getting Started
+
+### Syntax Highlighting
+
+First thing first, you will probably want proper syntax highlighting for `*.vue` components. Currently there are syntax highlighting support for [Sublime Text](https://github.com/vuejs/vue-syntax-highlight), [Atom](https://atom.io/packages/language-vue) and [Vim](https://github.com/posva/vim-vue). Contributions for other editors/IDEs are highly appreciated! If you are not using any pre-processors in Vue components, you can also get by by treating `*.vue` files as HTML in your editor.
+
+### Project Structure
+
+We are going to walk through setting up a Webpack + `vue-loader` project from scratch. If you are interested in ready-to-run examples, check out [vue-loader-example](https://github.com/vuejs/vue-loader-example) and [vue-hackernews](https://github.com/vuejs/vue-hackernews). However, if you are not already a Webpack expert, I highly recommend going through the following tutorial to understand how the pieces fit together.
+
+A simple `vue-loader` based project structure looks like this:
+
+``` bash
+.
+├── index.html
+├── main.js
+├── components
+│ ├── App.vue
+│ ├── ComponentA.vue
+│ └── ComponentB.vue
+├── package.json
+└── webpack.config.js
+```
+
+### Installing Dependencies
+
+Before we write any code, we need to install the proper NPM dependencies. Let's run:
+
+``` bash
+# Create a package.json file.
+# fill in the questions as you desire.
+npm init
+
+# Install everything we need
+npm install\
+ webpack webpack-dev-server\
+ vue-loader vue-html-loader css-loader style-loader vue-hot-reload-api\
+ babel-loader babel-core babel-plugin-transform-runtime babel-preset-es2015\
+ babel-runtime@5\
+ --save-dev
+```
+
+That's a lot of dependencies, I know! This is mostly because `vue-loader` need to have other webpack loaders as **peer dependencies** rather than nested dependencies so that Webpack can find them.[^(1)]
+
+You may also notice that we are using `babel-runtime` version 5 instead of the latest 6.x - this is [intentional](https://github.com/vuejs/vue-loader/issues/96#issuecomment-162910917).
+
+After proper installation, your `package.json`'s `devDependencies` field should look like this:
+
+``` json
+...
+ "devDependencies": {
+ "babel-core": "^6.3.17",
+ "babel-loader": "^6.2.0",
+ "babel-plugin-transform-runtime": "^6.3.13",
+ "babel-preset-es2015": "^6.3.13",
+ "babel-runtime": "^5.8.34",
+ "css-loader": "^0.23.0",
+ "style-loader": "^0.13.0",
+ "vue-hot-reload-api": "^1.2.2",
+ "vue-html-loader": "^1.0.0",
+ "vue-loader": "^7.2.0",
+ "webpack": "^1.12.9",
+ "webpack-dev-server": "^1.14.0"
+ },
+...
+```
+
+### Configuring Webpack
+
+Here's the most basic Webpack configuration for `vue-loader`:
+
+``` js
+// webpack.config.js
+module.exports = {
+ // entry point of our application
+ entry: './main.js',
+ // where to place the compiled bundle
+ output: {
+ path: __dirname,
+ filename: 'build.js'
+ },
+ module: {
+ // `loaders` is an array of loaders to use.
+ // here we are only configuring vue-loader
+ loaders: [
+ {
+ test: /\.vue$/, // a regex for matching all files that end in `.vue`
+ loader: 'vue' // loader to use for matched files
+ }
+ ]
+ }
+}
+```
+
+With the above configuration, when you write the following in your JavaScript code:
+
+``` js
+var MyComponent = require('./my-component.vue')
+```
+
+Webpack knows it needs to pipe the contents of `./my-component.vue` through `vue-loader`, because the filename matches the regex we provided in the config.
+
+### Creating Other Files
+
+The app entry point, `main.js` typically looks like this:
+
+``` js
+// main.js
+var Vue = require('vue')
+// require a *.vue component
+var App = require('./components/App.vue')
+
+// mount a root Vue instance
+new Vue({
+ el: 'body',
+ components: {
+ // include the required component
+ // in the options
+ app: App
+ }
+})
+```
+
+Inside a `*.vue` component's `
+```
+
+Next, let's create an `index.html` that simply uses the bundled file:
+
+``` html
+
+
+
+
+
+```
+
+### Running It
+
+Finally, it's time to get it running! We will simply use [NPM scripts](https://docs.npmjs.com/misc/scripts) as our task runner, which is sufficient in most cases. Add the following to your `package.json`:
+
+``` json
+...
+"scripts": {
+ "dev": "webpack-dev-server --inline --hot"
+}
+...
+```
+
+Then run:
+
+``` bash
+npm run dev
+```
+
+And you should see your app working at `http://localhost:8080`, with hot-reloading enabled!
+
+---
+
+[^(1)] If you are using NPM version 2.x, when you do `npm install vue-loader --save-dev` it will install and save all the peer dependencies for you. However, if you are using NPM 3.x, these peer dependencies will no longer be automatically installed. You will have to install them explicitly like we did above. Another way to deal with it is to simply copy `vue-loader`'s peer dependencies into your `package.json`'s `devDependencies` field and then run `npm install`.
diff --git a/docs/guide/README.md b/docs/guide/README.md
deleted file mode 100644
index d4b89fd61..000000000
--- a/docs/guide/README.md
+++ /dev/null
@@ -1,92 +0,0 @@
-# Getting Started
-
-## Vue CLI
-
-If you are not interested in manually setting up webpack, it is recommended to scaffold a project with [Vue CLI](https://github.com/vuejs/vue-cli) instead. Projects created by Vue CLI are pre-configured with most of the common development needs working out of the box.
-
-Follow this guide if the built-in configuration of Vue CLI does not suit your needs, or you'd rather create your own webpack config from scratch.
-
-## Manual Setup
-
-### Installation
-
-Unless you are an advanced user using your own forked version of Vue's template compiler, you should install `vue-loader` and `vue-template-compiler` together:
-
-``` bash
-npm install -D vue-loader vue-template-compiler
-```
-
-The reason `vue-template-compiler` has to be installed separately is so that you can individually specify its version.
-
-Every time a new version of `vue` is released, a corresponding version of `vue-template-compiler` is released together. The compiler's version must be in sync with the base `vue` package so that `vue-loader` produces code that is compatible with the runtime. This means **every time you upgrade `vue` in your project, you should upgrade `vue-template-compiler` to match it as well.**
-
-### webpack Configuration
-
-Vue Loader's configuration is a bit different from other loaders. In addition to a rule that applies `vue-loader` to any files with extension `.vue`, make sure to add Vue Loader's plugin to your webpack config:
-
-``` js
-// webpack.config.js
-const { VueLoaderPlugin } = require('vue-loader')
-
-module.exports = {
- module: {
- rules: [
- // ... other rules
- {
- test: /\.vue$/,
- loader: 'vue-loader'
- }
- ]
- },
- plugins: [
- // make sure to include the plugin!
- new VueLoaderPlugin()
- ]
-}
-```
-
-**The plugin is required!** It is responsible for cloning any other rules you have defined and applying them to the corresponding language blocks in `.vue` files. For example, if you have a rule matching `/\.js$/`, it will be applied to `
-```
-
-Refer to the [CSS Modules spec](https://github.com/css-modules/css-modules) for mode details such as [global exceptions](https://github.com/css-modules/css-modules#exceptions) and [composition](https://github.com/css-modules/css-modules#composition).
-
-## Opt-in Usage
-
-If you only want to use CSS Modules in some of your Vue components, you can use a `oneOf` rule and check for the `module` string in `resourceQuery`:
-
-``` js
-// webpack.config.js -> module.rules
-{
- test: /\.css$/,
- oneOf: [
- // this matches `
-
-
-```
diff --git a/docs/guide/custom-blocks.md b/docs/guide/custom-blocks.md
deleted file mode 100644
index f34c18317..000000000
--- a/docs/guide/custom-blocks.md
+++ /dev/null
@@ -1,96 +0,0 @@
-# Custom Blocks
-
-You can define custom language blocks inside `*.vue` files. Loaders applied for a custom block are matched based on the `lang` attribute of the block, the block's tag name, and the rules in your webpack config.
-
-If a `lang` attribute is specified, the custom block will be matched as a file with the `lang` as its extension.
-
-You can also use `resourceQuery` to match a rule against a custom block with no `lang`. For example, to match against `` custom blocks:
-
-``` js
-{
- module: {
- rules: [
- {
- resourceQuery: /blockType=foo/,
- loader: 'loader-to-use'
- }
- ]
- }
-}
-```
-
-If a matching rule is found for a custom block, it will be processed; otherwise the custom block will be silently ignored.
-
-Additionally, if the custom block exports a function as the final result after being processed by all the matching loaders, that function will be called with the component of the `*.vue` file as a parameter.
-
-## Example
-
-Here's an example of injecting the `` custom blocks into the component so that it's available during runtime.
-
-In order for the custom block content to be injected, we'll write a custom loader:
-
-``` js
-module.exports = function (source, map) {
- this.callback(
- null,
- `export default function (Component) {
- Component.options.__docs = ${
- JSON.stringify(source)
- }
- }`,
- map
- )
-}
-```
-
-Now we'll configure webpack to use our custom loader for `` custom blocks.
-
-``` js
-// wepback.config.js
-module.exports = {
- module: {
- rules: [
- {
- resourceQuery: /blockType=docs/,
- loader: require.resolve('./docs-loader.js')
- }
- ]
- }
-}
-```
-
-We are now able to access the `` block's content of imported components during runtime.
-
-``` vue
-
-
-
Hello
-
-
-
-This is the documentation for component B.
-
-```
-
-``` vue
-
-
-
-
-
{{ docs }}
-
-
-
-
-```
diff --git a/docs/guide/extract-css.md b/docs/guide/extract-css.md
deleted file mode 100644
index 7557392b7..000000000
--- a/docs/guide/extract-css.md
+++ /dev/null
@@ -1,75 +0,0 @@
-# CSS Extraction
-
-::: tip
-Only apply CSS extraction for production so that you get CSS hot reload during development.
-:::
-
-## webpack 4
-
-``` bash
-npm install -D mini-css-extract-plugin
-```
-
-``` js
-// webpack.config.js
-var MiniCssExtractPlugin = require('mini-css-extract-plugin')
-
-module.exports = {
- // other options...
- module: {
- rules: [
- // ... other rules omitted
- {
- test: /\.css$/,
- use: [
- process.env.NODE_ENV !== 'production'
- ? 'vue-style-loader'
- : MiniCssExtractPlugin.loader,
- 'css-loader'
- ]
- }
- ]
- },
- plugins: [
- // ... Vue Loader plugin omitted
- new MiniCssExtractPlugin({
- filename: 'style.css'
- })
- ]
-}
-```
-
-Also see [mini-css-extract-plugin docs](https://github.com/webpack-contrib/mini-css-extract-plugin).
-
-## webpack 3
-
-``` bash
-npm install -D extract-text-webpack-plugin
-```
-
-``` js
-// webpack.config.js
-var ExtractTextPlugin = require("extract-text-webpack-plugin")
-
-module.exports = {
- // other options...
- module: {
- rules: [
- // ... other rules omitted
- {
- test: /\.css$/,
- loader: ExtractTextPlugin.extract({
- use: 'css-loader',
- fallback: 'vue-style-loader'
- })
- }
- ]
- },
- plugins: [
- // ... Vue Loader plugin omitted
- new ExtractTextPlugin("style.css")
- ]
-}
-```
-
-Also see [extract-text-webpack-plugin docs](https://github.com/webpack-contrib/extract-text-webpack-plugin).
diff --git a/docs/guide/functional.md b/docs/guide/functional.md
deleted file mode 100644
index afbdfb7a4..000000000
--- a/docs/guide/functional.md
+++ /dev/null
@@ -1,21 +0,0 @@
-# Functional Components
-
-Functional components defined as a Single-File Component in a `*.vue` file also receives proper template compilation, Scoped CSS and hot-reloading support.
-
-To denote a template that should be compiled as a functional component, add the `functional` attribute to the template block. This also allows omitting the `functional` option in the `
-
-
-```
-
-Использование `vue-loader` предоставляет множество интересных возможностей:
-
-- Позволяет использовать разнообразные загрузчики webpack для разных секций компонента Vue, например Sass для `
-```
-
-Атрибут `module` подскажет Vue Loader о необходимости внедрить CSS модуль в компонент в качестве вычисляемого свойства с именем `$style`. Вы можете использовать его в шаблонах для динамического добавления классов:
-
-``` vue
-
-
- Текст должен быть красным
-
-
-```
-
-Поскольку это вычисляемое свойство, оно будет работать с объектом/массивом в `:class`:
-
-``` vue
-
-
-
- Буду ли я красным?
-
-
- Красный и жирный
-
-
-
-```
-
-Вы также можете получить доступ в JavaScript:
-
-``` vue
-
-```
-
-Обратитесь к [спецификации CSS-модулей](https://github.com/css-modules/css-modules) для получения информации о [глобальных исключениях](https://github.com/css-modules/css-modules#exceptions) и [композиции](https://github.com/css-modules/css-modules#composition).
-
-## Опциональное использование
-
-Если вы хотите использовать CSS модули только в некоторых компонентах Vue, вы можете использовать правило `oneOf` и проверять наличие строки `module` внутри `resourceQuery`:
-
-``` js
-// webpack.config.js -> module.rules
-{
- test: /\.css$/,
- oneOf: [
- // это соответствует `
-
-
-```
diff --git a/docs/ru/guide/custom-blocks.md b/docs/ru/guide/custom-blocks.md
deleted file mode 100644
index 6ac91f677..000000000
--- a/docs/ru/guide/custom-blocks.md
+++ /dev/null
@@ -1,94 +0,0 @@
-# Пользовательские блоки
-
-Вы можете определять пользовательские блоки внутри файлов `*.vue`. Загрузчики, применяемые к такому блоку, будут определяться сопоставлением по атрибуту `lang` блока, имени тега блока, и правил в вашей конфигурации webpack.
-
-Если указан атрибут `lang`, пользовательский блок будет обработан как файл с расширением, указанном в `lang`.
-
-Вы также можете использовать `resourceQuery` для определения правила для блока без атрибута `lang`. Например, для сопоставления пользовательского блока ``:
-
-```js
-{
- module: {
- rules: [
- {
- resourceQuery: /blockType=foo/,
- loader: "loader-to-use"
- }
- ];
- }
-}
-```
-
-Если для пользовательского блока будет найдено правило — он будет им обработан; в противном случае пользовательский блок будет тихо проигнорирован.
-
-Кроме того, если пользовательский блок экспортирует функцию в качестве конечного результата после обработки всеми соответствующими загрузчиками, то эта функция будет вызываться с компонентом файла `*.vue` в качестве параметра.
-
-## Пример
-
-Небольшой пример внедрения пользовательского блока `` в компонент таким образом, что он будет доступен во время выполнения.
-
-Для внедрения содержимого пользовательского блока мы напишем собственный загрузчик:
-
-```js
-module.exports = function(source, map) {
- this.callback(
- null,
- `export default function (Component) {
- Component.options.__docs = ${JSON.stringify(source)}
- }`,
- map
- );
-};
-```
-
-Настроим webpack использовать наш загрузчик для пользовательских блоков ``.
-
-```js
-// wepback.config.js
-module.exports = {
- module: {
- rules: [
- {
- resourceQuery: /blockType=docs/,
- loader: require.resolve("./docs-loader.js")
- }
- ]
- }
-};
-```
-
-Теперь мы можем получить доступ к содержимому блока `` импортированного компонента на этапе выполнения.
-
-```vue
-
-
-
Hello
-
-
-
-This is the documentation for component B.
-
-```
-
-```vue
-
-
-
-
-
{{ docs }}
-
-
-
-
-```
diff --git a/docs/ru/guide/extract-css.md b/docs/ru/guide/extract-css.md
deleted file mode 100644
index 94f61d36d..000000000
--- a/docs/ru/guide/extract-css.md
+++ /dev/null
@@ -1,75 +0,0 @@
-# Извлечение CSS в отдельный файл
-
-::: tip СОВЕТ
-Применяйте извлечение CSS в отдельный файл только в production, чтобы использовать горячую перезагрузку CSS на этапе разработки.
-:::
-
-## webpack 4
-
-``` bash
-npm install -D mini-css-extract-plugin
-```
-
-``` js
-// webpack.config.js
-var MiniCssExtractPlugin = require('mini-css-extract-plugin')
-
-module.exports = {
- // другие настройки...
- module: {
- rules: [
- // ... другие правила опущены
- {
- test: /\.css$/,
- use: [
- process.env.NODE_ENV !== 'production'
- ? 'vue-style-loader'
- : MiniCssExtractPlugin.loader,
- 'css-loader'
- ]
- }
- ]
- },
- plugins: [
- // ... плагин Vue Loader опущен
- new MiniCssExtractPlugin({
- filename: 'style.css'
- })
- ]
-}
-```
-
-Также смотрите [документацию mini-css-extract-plugin](https://github.com/webpack-contrib/mini-css-extract-plugin).
-
-## webpack 3
-
-``` bash
-npm install -D extract-text-webpack-plugin
-```
-
-``` js
-// webpack.config.js
-var ExtractTextPlugin = require("extract-text-webpack-plugin")
-
-module.exports = {
- // другие настройки...
- module: {
- rules: [
- // ... другие правила опущены
- {
- test: /\.css$/,
- loader: ExtractTextPlugin.extract({
- use: 'css-loader',
- fallback: 'vue-style-loader'
- })
- }
- ]
- },
- plugins: [
- // ... плагин Vue Loader опущен
- new ExtractTextPlugin("style.css")
- ]
-}
-```
-
-Также смотрите [документацию extract-text-webpack-plugin](https://github.com/webpack-contrib/extract-text-webpack-plugin).
diff --git a/docs/ru/guide/functional.md b/docs/ru/guide/functional.md
deleted file mode 100644
index 421979506..000000000
--- a/docs/ru/guide/functional.md
+++ /dev/null
@@ -1,21 +0,0 @@
-# Функциональные компоненты
-
-Функциональные компоненты, объявленные как однофайловые компоненты в файле `*.vue`, также получают правильную поддержку компиляции шаблона, локальный CSS и поддержку горячей перезагрузки.
-
-Чтобы обозначить шаблон, который должен быть скомпилирован как функциональный компонент, добавьте атрибут `functional` в тег шаблона. Это также позволяет опустить опцию `functional` в теге `
-
-
-
-
- Это может быть, например, документация для компонента
-
-```
-
-`vue-loader` парсит файл, извлекает каждую из секций, обрабатывает их при необходимости другими загрузчиками webpack, и в итоге собирает всё обратно в ES-модуль где экспорт по умолчанию будет объектом настроек компонента Vue.js.
-
-`vue-loader` предоставляет возможность использовать нестандартные языки, например пре-процессоры CSS и языки шаблонов компилируемые в HTML, указывая атрибут `lang` для секции файла. Например, вы можете использовать Sass для стилей вашего компонента:
-
-``` vue
-
-```
-
-Подробнее на странице [использования пре-процессоров](./guide/pre-processors.md).
-
-## Секции файла
-
-### Шаблон (template)
-
-- Каждый `*.vue` файл может содержать максимум один блок ``.
-
-- Содержимое извлекается, передаётся в `vue-template-compiler`, где предварительно будет скомпилировано в JavaScript render-функции, и наконец внедряется в описываемый компонент в секции `
-```
-
-Обратите внимание, что импорты через `src` следуют тем же правилам webpack по разрешению путей к модулям, что означает:
-
-- Относительные пути должны начинаться с `./`
-- Вы можете импортировать ресурсы из npm-зависимостей:
-
-``` vue
-
-
-
-
- This could be e.g. documentation for the component.
-
-```
-
-`vue-loader` will parse the file, extract each language block, pipe them through other loaders if necessary, and finally assemble them back into an ES Module whose default export is a Vue.js component options object.
-
-`vue-loader` supports using non-default languages, such as CSS pre-processors and compile-to-HTML template languages, by specifying the `lang` attribute for a language block. For example, you can use Sass for the style of your component like this:
-
-``` vue
-
-```
-
-More details can be found in [Using Pre-Processors](./guide/pre-processors.md).
-
-## Language Blocks
-
-### Template
-
-- Each `*.vue` file can contain at most one `` block at a time.
-
-- Contents will be extracted and passed on to `vue-template-compiler` and pre-compiled into JavaScript render functions, and finally injected into the exported component in the `
-```
-
-Beware that `src` imports follow the same path resolution rules to webpack module requests, which means:
-
-- Relative paths need to start with `./`
-- You can import resources from npm dependencies:
-
-``` vue
-
-
+```
+
+`vue-loader` will parse the file, extract each language block, pipe them through other loaders if necessary, and finally assemble them back into a CommonJS module whose `module.exports` is a Vue.js component options object.
+
+`vue-loader` supports using non-default languages, such as CSS pre-processors and compile-to-HTML template languages, by specifying the `lang` attribute for a language block. For example, you can use SASS for the style of your component like this:
+
+``` html
+
+```
+
+More details can be found in [Using Pre-Processors](../configurations/pre-processors.md).
+
+### Language Blocks
+
+#### ``
+
+- Default language: `html`.
+
+- Each `*.vue` file can contain at most one `` block at a time.
+
+- Contents will be extracted as a string and used as the `template` option for the compiled Vue component.
+
+#### `
+```
+
+Beware that `src` imports follow the same path resolution rules to CommonJS `require()` calls, which means for relative paths you need to start with `./`, and you can import resources directly from installed NPM packages, e.g:
+
+``` html
+
+
-```
-
-Vue Loader 还提供了很多酷炫的特性:
-
-- 允许为 Vue 组件的每个部分使用其它的 webpack loader,例如在 `
-```
-
-这个 `module` 特性指引 Vue Loader 作为名为 `$style` 的计算属性,向组件注入 CSS Modules 局部对象。然后你就可以在模板中通过一个动态类绑定来使用它了:
-
-``` vue
-
-