ember-css-modules 2.0.0 → 2.0.1

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.
@@ -142,9 +142,18 @@ module.exports = class ClassTransformPlugin {
142
142
 
143
143
  utils.pushAll(parts, this.localToPath(localClassAttr.value));
144
144
  this.divide(parts, 'text');
145
- node.attributes.unshift(
146
- this.builders.attr('class', this.builders.concat(parts))
147
- );
145
+
146
+ let newClassAttr = this.builders.attr('class', this.builders.concat(parts));
147
+ node.attributes.unshift(newClassAttr);
148
+
149
+ // In new-enough versions of Ember (>= 3.25 or so), we need to create a
150
+ // fake good-enough `loc` whose content will start with `class=` to avoid
151
+ // triggering https://github.com/emberjs/ember.js/issues/19392
152
+ if (typeof localClassAttr.loc.slice === 'function') {
153
+ newClassAttr.loc = localClassAttr.loc.slice({
154
+ skipStart: 'local-'.length,
155
+ });
156
+ }
148
157
  }
149
158
 
150
159
  localToPath(node) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ember-css-modules",
3
- "version": "2.0.0",
3
+ "version": "2.0.1",
4
4
  "description": "CSS Modules for ambitious applications",
5
5
  "scripts": {
6
6
  "build": "ember build --environment=production",