@@ -3,24 +3,27 @@ import { importSync } from '@embroider/macros';
3
3
import babelPluginEmberTemplateCompilation from 'babel-plugin-ember-template-compilation' ;
4
4
5
5
// TODO: use real packages, and not these copied files from ember-template-imports
6
- import babelPluginIntermediateGJS from './eti/babel-plugin' ;
7
- import { preprocessEmbeddedTemplates } from './eti/preprocess' ;
8
- import { TEMPLATE_TAG_NAME , TEMPLATE_TAG_PLACEHOLDER } from './eti/util' ;
9
-
6
+ // import babelPluginIntermediateGJS from './eti/babel-plugin';
7
+ // import { preprocessEmbeddedTemplates } from './eti/preprocess';
8
+ // import { TEMPLATE_TAG_NAME, TEMPLATE_TAG_PLACEHOLDER } from './eti/util';
10
9
import type { Babel } from './types' ;
11
10
12
11
const compiler = importSync ( 'ember-source/dist/ember-template-compiler.js' ) ;
13
12
14
- export function preprocess ( input : string , name : string ) {
15
- let preprocessed = preprocessEmbeddedTemplates ( input , {
16
- relativePath : `${ name } .js` ,
17
- includeSourceMaps : false ,
18
- includeTemplateTokens : true ,
19
- templateTag : TEMPLATE_TAG_NAME ,
20
- templateTagReplacement : TEMPLATE_TAG_PLACEHOLDER ,
21
- } ) ;
13
+ import { Preprocessor } from 'content-tag' ;
22
14
23
- return preprocessed . output ;
15
+ const processor = new Preprocessor ( ) ;
16
+
17
+ export function preprocess ( input : string , name : string ) {
18
+ // let preprocessed = preprocessEmbeddedTemplates(input, {
19
+ // relativePath: `${name}.js`,
20
+ // includeSourceMaps: false,
21
+ // includeTemplateTokens: true,
22
+ // templateTag: TEMPLATE_TAG_NAME,
23
+ // templateTagReplacement: TEMPLATE_TAG_PLACEHOLDER,
24
+ // });
25
+
26
+ return processor . process ( input , `${ name } .js` ) ;
24
27
}
25
28
26
29
export async function transform (
@@ -33,7 +36,7 @@ export async function transform(
33
36
return babel . transform ( intermediate , {
34
37
filename : `${ name } .js` ,
35
38
plugins : [
36
- [ babelPluginIntermediateGJS ] ,
39
+ // [babelPluginIntermediateGJS],
37
40
[
38
41
babelPluginEmberTemplateCompilation ,
39
42
{
0 commit comments