You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -114,7 +114,7 @@ Then you can happily start coding. While writing code, you can use the `npm` com
114
114
npm add xxx
115
115
```
116
116
117
-
However, it is important to note that these dependencies will ultimately be packed into `./dist/index.js`, and this file should not be too large, so try to avoid referencing too many third-party libraries.
117
+
However, it is important to note that these dependencies will ultimately be packed into `./dist/index.ts`, and this file should not be too large, so try to avoid referencing too many third-party libraries.
118
118
119
119
At the same time, you can now organize your code in a modular way under the `src` directory, instead of struggling with a single `JavaScript` file that is thousands of lines long as before (single-file development is simply a form of mental torture...):
120
120
@@ -126,17 +126,17 @@ When you need to test, execute:
126
126
npm run watch
127
127
```
128
128
129
-
Then copy the file header from `./dist/index.js` to your Tampermonkey extension:
129
+
Then copy the file header from `./dist/index.ts` to your Tampermonkey extension:
And at the end, add a line to import the compiled file, noting that the `file://` followed by the address points to the absolute path of your compiled `./dist/index.js`:
133
+
And at the end, add a line to import the compiled file, noting that the `file://` followed by the address points to the absolute path of your compiled `./dist/index.ts`:
For example, here is an actual example of a Tampermonkey script used during development. The Tampermonkey script does not contain actual code but uses `require` to point to our `build` files. This way, when the code is modified and `webpack` automatically hot compiles, the `./dist/index.js` referenced in the browser is also the latest:
139
+
For example, here is an actual example of a Tampermonkey script used during development. The Tampermonkey script does not contain actual code but uses `require` to point to our `build` files. This way, when the code is modified and `webpack` automatically hot compiles, the `./dist/index.ts` referenced in the browser is also the latest:
140
140
141
141
```js
142
142
// ==UserScript==
@@ -148,12 +148,12 @@ For example, here is an actual example of a Tampermonkey script used during deve
Please note that when you debug using the method `// @require file://D:/workspace/userscript-template/dist/index.js`, your Tampermonkey extension should be configured to allow access to file URLs (by default, it is not allowed). Right-click on the browser plugin icon and select "Manage Extensions":
156
+
Please note that when you debug using the method `// @require file://D:/workspace/userscript-template/dist/index.ts`, your Tampermonkey extension should be configured to allow access to file URLs (by default, it is not allowed). Right-click on the browser plugin icon and select "Manage Extensions":
0 commit comments