Skip to content

Commit

Permalink
Merge pull request #1786 from vstefanovic97/stable
Browse files Browse the repository at this point in the history
Bump content-tag and add inline_source_map option for rollup and vite
  • Loading branch information
NullVoxPopuli authored Feb 1, 2024
2 parents 062d357 + 6718666 commit 1ff8f08
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 12 deletions.
2 changes: 1 addition & 1 deletion packages/addon-dev/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
"dependencies": {
"@embroider/core": "workspace:^",
"@rollup/pluginutils": "^4.1.1",
"content-tag": "^1.1.2",
"content-tag": "^2.0.1",
"fs-extra": "^10.0.0",
"minimatch": "^3.0.4",
"rollup-plugin-copy-assets": "^2.0.3",
Expand Down
9 changes: 7 additions & 2 deletions packages/addon-dev/src/rollup-gjs-plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@ const PLUGIN_NAME = 'rollup-gjs-plugin';
const processor = new Preprocessor();
// import { parse as pathParse } from 'path';

export default function rollupGjsPlugin(): Plugin {
export default function rollupGjsPlugin(
{ inline_source_map } = { inline_source_map: false }
): Plugin {
return {
name: PLUGIN_NAME,

Expand All @@ -17,7 +19,10 @@ export default function rollupGjsPlugin(): Plugin {
return null;
}
let input = readFileSync(id, 'utf8');
let code = processor.process(input, id);
let code = processor.process(input, {
filename: id,
inline_source_map,
});
return {
code,
};
Expand Down
2 changes: 1 addition & 1 deletion packages/vite/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"dependencies": {
"@rollup/pluginutils": "^4.1.1",
"assert-never": "^1.2.1",
"content-tag": "^1.1.2",
"content-tag": "^2.0.1",
"debug": "^4.3.2",
"fs-extra": "^10.0.0",
"jsdom": "^16.6.0",
Expand Down
7 changes: 5 additions & 2 deletions packages/vite/src/template-tag.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { Preprocessor } from 'content-tag';

const gjsFilter = createFilter('**/*.gjs');

export function templateTag(): Plugin {
export function templateTag({ inline_source_map } = { inline_source_map: false }): Plugin {
let preprocessor = new Preprocessor();

function candidates(id: string) {
Expand Down Expand Up @@ -44,7 +44,10 @@ export function templateTag(): Plugin {
if (!gjsFilter(id)) {
return null;
}
return preprocessor.process(readFileSync(id, 'utf8'), id);
return preprocessor.process(readFileSync(id, 'utf8'), {
filename: id,
inline_source_map: inline_source_map,
});
},
};
}
12 changes: 6 additions & 6 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 1ff8f08

Please sign in to comment.