diff --git a/.babelrc b/.babelrc new file mode 100644 index 000000000..3ed94dff9 --- /dev/null +++ b/.babelrc @@ -0,0 +1,5 @@ +{ + "presets": [ + ["env", { "modules": false }] + ] +} diff --git a/.eslintrc.js b/.eslintrc.js new file mode 100644 index 000000000..b31f02096 --- /dev/null +++ b/.eslintrc.js @@ -0,0 +1,8 @@ +module.exports = { + root: true, + extends: ['plugin:vue-libs/recommended'], + rules: { + indent: 'off', + 'space-before-function-paren': 'off' + } +} diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 000000000..6313b56c5 --- /dev/null +++ b/.gitattributes @@ -0,0 +1 @@ +* text=auto eol=lf diff --git a/.github/ISSUE_TEMPLATE.md b/.github/ISSUE_TEMPLATE.md new file mode 100644 index 000000000..bd0e4f286 --- /dev/null +++ b/.github/ISSUE_TEMPLATE.md @@ -0,0 +1,7 @@ + diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 47ac721a2..04b761d0a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -2,46 +2,45 @@ name: 'ci' on: push: branches: - - '**' + - v15 pull_request: branches: - - main + - v15 jobs: - test-webpack4: - runs-on: ubuntu-latest + 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@v3 - - uses: pnpm/action-setup@v2 - - uses: actions/setup-node@v3 - with: - node-version: '16' - cache: 'pnpm' - - run: pnpm install - - run: pnpm pretest:webpack4 - - run: pnpm test:webpack4 + - uses: actions/checkout@v2 - test-webpack5: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - uses: pnpm/action-setup@v2 - - uses: actions/setup-node@v3 + - name: Install pnpm + uses: pnpm/action-setup@v2 with: - node-version: '16' - cache: 'pnpm' - - run: pnpm install - - run: pnpm pretest - - run: pnpm test + version: 7 - test-webpack5-inline-match-resource: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - uses: pnpm/action-setup@v2 - - uses: actions/setup-node@v3 + - name: Set node version to 16 + uses: actions/setup-node@v2 with: - node-version: '16' + node-version: 16 cache: 'pnpm' + - run: pnpm install - - run: pnpm pretest:match-resource - - run: pnpm test:match-resource + + - 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 7ff6b0d08..914a2dab2 100644 --- a/.gitignore +++ b/.gitignore @@ -1,10 +1,10 @@ -*.log +.idea .DS_Store +exploration node_modules -dist -dist-ssr -link.sh -.cache -TODOs.md -coverage +*.log +example/dist +docs/.vuepress/dist +test/.cache .vscode +TODOS diff --git a/.node-version b/.node-version deleted file mode 100644 index 9e15be387..000000000 --- a/.node-version +++ /dev/null @@ -1 +0,0 @@ -v16.20.0 diff --git a/.npmignore b/.npmignore new file mode 100644 index 000000000..6e52da593 --- /dev/null +++ b/.npmignore @@ -0,0 +1,10 @@ +example +test +*.yml +*.log +yarn.lock +tsconfig.json +docs +.github +.vscode +TODOS diff --git a/.prettierrc b/.prettierrc deleted file mode 100644 index f5a1bdcdd..000000000 --- a/.prettierrc +++ /dev/null @@ -1,3 +0,0 @@ -semi: false -singleQuote: true -printWidth: 80 diff --git a/.vscode/settings.json b/.vscode/settings.json deleted file mode 100644 index 3662b3700..000000000 --- a/.vscode/settings.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "typescript.tsdk": "node_modules/typescript/lib" -} \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index 311c35af7..75340af8a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,533 +1,730 @@ -## [17.4.2](https://github.com/vuejs/vue-loader/compare/v17.4.1...v17.4.2) (2023-12-30) + +# [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 -* pass compilerOptions to sfc parse & re-enable AST reuse ([d2a2e05](https://github.com/vuejs/vue-loader/commit/d2a2e051c3d985d1ae6bb468749b24543631b482)) +* always pass id to stylePostLoader when possible ([364ad09](https://github.com/vuejs/vue-loader/commit/364ad09)) -## [17.4.1](https://github.com/vuejs/vue-loader/compare/v17.4.0...v17.4.1) (2023-12-30) + +# [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 -* (temporarily) disable template ast reuse ([31b03af](https://github.com/vuejs/vue-loader/commit/31b03af121edbe70337f538b1def95acbef4d0f1)) +* css v-bind in production mode ([655e5f8](https://github.com/vuejs/vue-loader/commit/655e5f8)) -# [17.4.0](https://github.com/vuejs/vue-loader/compare/v17.3.1...v17.4.0) (2023-12-25) + +# [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 -* leverage ast reuse in 3.4 ([479835f](https://github.com/vuejs/vue-loader/commit/479835fe751691a39c62cda12bffeef9e6830443)) +* support css v-bind (requires 2.7.0-beta.3) ([d653f3b](https://github.com/vuejs/vue-loader/commit/d653f3b)) -## [17.3.1](https://github.com/vuejs/vue-loader/compare/v17.3.0...v17.3.1) (2023-10-31) + +# [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 -* do not skip style post loader for v-bind() in CSS ([d7071bb](https://github.com/vuejs/vue-loader/commit/d7071bbdeb45518c053bdae8eb7de52fc598adc6)), closes [#2061](https://github.com/vuejs/vue-loader/issues/2061) +* cache descriptor with correct resource path ([f6c83b5](https://github.com/vuejs/vue-loader/commit/f6c83b5)) -# [17.3.0](https://github.com/vuejs/vue-loader/compare/v17.2.2...v17.3.0) (2023-10-07) + +# [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)) -### Bug Fixes -* re-use ident of vue rule for template compiler, fixes [#2029](https://github.com/vuejs/vue-loader/issues/2029) ([#2030](https://github.com/vuejs/vue-loader/issues/2030)) ([b50fa56](https://github.com/vuejs/vue-loader/commit/b50fa5665f2cbc1c0b8e18f65dd3adf1dfe848dc)) + + +# [15.10.0-beta.1](https://github.com/vuejs/vue-loader/compare/v15.9.8...v15.10.0-beta.1) (2022-06-14) ### Features -* skip normal css files without scoped flag in stylePostLoader ([#2053](https://github.com/vuejs/vue-loader/issues/2053)) ([98782e7](https://github.com/vuejs/vue-loader/commit/98782e794fadca83b600b047b55aa6f0c230cc25)) +* 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 ` @@ -67,72 +49,72 @@ In a nutshell, the combination of webpack and `vue-loader` gives you a modern, f `vue-loader` is not a simple source transform loader. It handles each language blocks inside an SFC with its own dedicated loader chain (you can think of each block as a "virtual module"), and finally assembles the blocks together into the final module. Here's a brief overview of how the whole thing works: -1. `vue-loader` parses the SFC source code into an _SFC Descriptor_ using `@vue/compiler-sfc`. It then generates an import for each language block so the actual returned module code looks like this: +1. `vue-loader` parses the SFC source code into an *SFC Descriptor* using `@vue/component-compiler-utils`. It then generates an import for each language block so the actual returned module code looks like this: - ```js - // code returned from the main loader for 'source.vue' + ``` js + // code returned from the main loader for 'source.vue' - // import the