ember-scoped-css 0.4.1 → 0.5.0

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ember-scoped-css",
3
- "version": "0.4.1",
3
+ "version": "0.5.0",
4
4
  "description": "",
5
5
  "keywords": [],
6
6
  "license": "ISC",
@@ -14,11 +14,11 @@ export default createUnplugin(() => {
14
14
  name: 'addon-js-unplugin',
15
15
 
16
16
  transformInclude(id) {
17
- return id.endsWith('.js');
17
+ return id.endsWith('.js') || id.endsWith('.ts');
18
18
  },
19
19
 
20
20
  async transform(code, jsPath) {
21
- const cssPath = jsPath.replace(/(\.hbs)?\.js$/, '.css');
21
+ const cssPath = jsPath.replace(/(\.hbs)?\.((js)|(ts))$/, '.css');
22
22
  const cssFileName = path.basename(cssPath);
23
23
 
24
24
  const cssExists = await fsExists(cssPath);
@@ -13,14 +13,16 @@ export default function () {
13
13
  }
14
14
  const postfix = getPostfix(id);
15
15
  const jsPath = id.replace(/\.css$/, '.gjs');
16
+ const gtsPath = id.replace(/\.css$/, '.gts');
16
17
  const hbsPath = id.replace(/\.css$/, '.hbs');
17
18
 
18
- const [jsExists, hbsExists] = await Promise.all([
19
+ const [jsExists, gtsExists, hbsExists] = await Promise.all([
19
20
  fsExists(jsPath),
21
+ fsExists(gtsPath),
20
22
  fsExists(hbsPath),
21
23
  ]);
22
24
 
23
- if (jsExists || hbsExists) {
25
+ if (jsExists || hbsExists || gtsExists) {
24
26
  const rewritten = rewriteCss(code, postfix, path.basename(id));
25
27
  return rewritten;
26
28
  }