Skip to content

Commit

Permalink
Merge pull request #1359 from mansona/bang-requests
Browse files Browse the repository at this point in the history
Ignore resolve requests that start with !
  • Loading branch information
ef4 authored Feb 15, 2023
2 parents 07818cc + 6861242 commit 565e9e5
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 2 additions & 1 deletion packages/webpack/src/webpack-resolver-plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,8 @@ class WebpackModuleRequest implements ModuleRequest {
typeof state.context === 'string' &&
typeof state.contextInfo?.issuer === 'string' &&
state.contextInfo.issuer !== '' &&
!state.request.startsWith(virtualLoaderName) // prevents recursion on requests we have already sent to our virtual loader
!state.request.startsWith(virtualLoaderName) && // prevents recursion on requests we have already sent to our virtual loader
!state.request.startsWith('!') // ignores internal webpack resolvers
) {
return new WebpackModuleRequest(state);
}
Expand Down
2 changes: 2 additions & 0 deletions tests/scenarios/v2-addon-test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,14 @@ appScenarios
import Component from '@glimmer/component';
import { hbs } from 'ember-cli-htmlbars';
import { setComponentTemplate } from '@ember/component';
import './example-component.css';
const TEMPLATE = hbs('<div data-test-example>{{this.message}}</div>')
export default class ExampleComponent extends Component {
message = "it worked"
}
setComponentTemplate(TEMPLATE, ExampleComponent);
`,
'example-component.css': '/* not empty */ h1 { color: red }',
},
'import-from-npm.js': `
export default async function() {
Expand Down

0 comments on commit 565e9e5

Please sign in to comment.