-
-
Notifications
You must be signed in to change notification settings - Fork 431
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* map input source map * code review changes * reformat * remove usage of async/await * free memory of source map consumers * code review changes * copy input source map before modifying * fix comment * fix: crash because source map is not always generated by ts-compiler * chore: update yarn.lock * fix linting * add test * test * test * add new source maps * add readme * update bundle * link test package * install dependencies in during test execution * update package lock * update expected output * bump version and add changelog entry
- Loading branch information
Showing
21 changed files
with
39,739 additions
and
3,966 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 16 additions & 0 deletions
16
test/comparison-tests/sourceMapsShouldConsiderInputSourceMap/App.vue
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
<template> | ||
<h1>Hello World!</h1> | ||
</template> | ||
|
||
<script lang="ts"> | ||
/* eslint-disable import/no-extraneous-dependencies */ | ||
import { defineComponent } from "vue"; | ||
export default defineComponent({ | ||
components: { | ||
}, | ||
async created() { | ||
console.log("Hello World!"); | ||
}, | ||
}); | ||
</script> |
11 changes: 11 additions & 0 deletions
11
test/comparison-tests/sourceMapsShouldConsiderInputSourceMap/README.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# sourceMapsShouldConsiderInputSourceMap | ||
|
||
This test represents a typical Vue project which is configured to compile using the [vue-loader](https://github.com/vuejs/vue-loader) webpack loader. | ||
In this test we expect that `ts-loader` is considering the input source map which is generated by the `vue-loader`. | ||
|
||
## Background Information | ||
|
||
A Vue single file component (SFC) contains different parts of the component: the HTML template, the component's script (can be TypeScript) and sometimes CSS. | ||
The `vue-loader` is extracting the different parts of those SFCs and "sends" the different parts back to webpack together with a appropriate source map. | ||
Webpack then forwards those parts to the each different loaders that are next in the loader chain, which in the case for the script part is the `ts-loader`. | ||
`ts-loader` receives the isolated TypeScript code together with a source map and then further compiles the TypeScript code with the `tsc` and maps the newly generated source map to the input source map from `vue-loader`. |
6 changes: 6 additions & 0 deletions
6
test/comparison-tests/sourceMapsShouldConsiderInputSourceMap/bootloader.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
import { createApp } from "vue"; | ||
import App from "./App.vue"; | ||
|
||
const app = createApp(App); | ||
|
||
app.mount("#app"); |
Oops, something went wrong.