@acebuilder/component-tagger 0.1.2 → 0.1.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -4
- package/index.d.ts +2 -2
- package/index.js +16 -2
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -26,11 +26,11 @@ export default componentTagger()(nextConfig)
|
|
|
26
26
|
|
|
27
27
|
| Mode | Tagging |
|
|
28
28
|
|------|---------|
|
|
29
|
-
| `next dev` (
|
|
30
|
-
| `next dev --webpack` |
|
|
31
|
-
| `next build` |
|
|
29
|
+
| `next dev --turbopack` (default) | Build-time tagging via Turbopack custom loader rules |
|
|
30
|
+
| `next dev --webpack` | Build-time tagging via webpack pre-loader |
|
|
31
|
+
| `next build` | Build-time tagging (webpack) |
|
|
32
32
|
|
|
33
|
-
Turbopack
|
|
33
|
+
Turbopack rules omit the `as` field — including it caused broken module paths (`welcome.tsx.tsx`).
|
|
34
34
|
|
|
35
35
|
## AceBuilder sandboxes
|
|
36
36
|
|
package/index.d.ts
CHANGED
|
@@ -8,8 +8,8 @@ export interface AceBuilderComponentTaggerOptions {
|
|
|
8
8
|
export type WithAceBuilderComponentTagger = (config: NextConfig) => NextConfig
|
|
9
9
|
|
|
10
10
|
/**
|
|
11
|
-
* Next.js plugin —
|
|
12
|
-
*
|
|
11
|
+
* Next.js plugin — tags JSX with data-acebuilder-* attributes.
|
|
12
|
+
* Works with Turbopack (`next dev --turbopack`) and webpack.
|
|
13
13
|
*/
|
|
14
14
|
declare function withAceBuilderComponentTagger(
|
|
15
15
|
options?: AceBuilderComponentTaggerOptions,
|
package/index.js
CHANGED
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
/**
|
|
4
4
|
* Next.js plugin for AceBuilder component tagging.
|
|
5
5
|
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
6
|
+
* Works with both Turbopack (`next dev --turbopack`) and webpack (`next dev --webpack`).
|
|
7
|
+
* Note: Do NOT include `as` in the turbopack rules — that caused the `*.tsx.tsx` bug.
|
|
8
8
|
*/
|
|
9
9
|
const TAGGER_LOADER = require.resolve('./lib/loader')
|
|
10
10
|
|
|
@@ -14,6 +14,20 @@ const componentTagger = (pluginOptions = {}) => (inputConfig = {}) => {
|
|
|
14
14
|
/** @type {import('next').NextConfig} */
|
|
15
15
|
const nextConfig = {
|
|
16
16
|
...inputConfig,
|
|
17
|
+
turbopack: {
|
|
18
|
+
...(inputConfig.turbopack || {}),
|
|
19
|
+
rules: {
|
|
20
|
+
...(inputConfig.turbopack?.rules || {}),
|
|
21
|
+
// Turbopack custom loader rules for JSX/TSX files.
|
|
22
|
+
// Omitting `as` preserves the original file type and avoids the *.tsx.tsx double-extension bug.
|
|
23
|
+
'*.tsx': {
|
|
24
|
+
loaders: [TAGGER_LOADER],
|
|
25
|
+
},
|
|
26
|
+
'*.jsx': {
|
|
27
|
+
loaders: [TAGGER_LOADER],
|
|
28
|
+
},
|
|
29
|
+
},
|
|
30
|
+
},
|
|
17
31
|
webpack(config, options) {
|
|
18
32
|
config.module.rules.push({
|
|
19
33
|
test,
|
package/package.json
CHANGED