sprockets-commoner 0.2.3 → 0.2.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/js/babel-plugin-sprockets-commoner-internal/index.js +13 -1
- data/lib/sprockets/commoner/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 050e566c2312264eeea0ddadb4e080829145b5b7
|
4
|
+
data.tar.gz: e31e4762cd2d77377373a9ea64c2604484205b3e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d8c37e78ec66df4a9f7a9fdaf988b9510012eeed51e2bebd1f16794a8777c3505551d11481c4b0185234a6b03518a873f5cdc0eaef7cddc6fccb324f8d6d706e
|
7
|
+
data.tar.gz: 59d6ca6f918fdf4836457d2e50c6016a516c07fcb4336e10634bc03f7a4544fcecb07fb2e13144bff54450d00df4492e294d433558794680f6294a9f26250e71
|
data/CHANGELOG.md
CHANGED
@@ -276,9 +276,21 @@ module.exports = function (context) {
|
|
276
276
|
|
277
277
|
// Transform module to a variable assignment.
|
278
278
|
// This variable is then referenced by any dependant children.
|
279
|
-
|
279
|
+
var block = t.blockStatement(node.body, node.directives);
|
280
|
+
var f = t.functionExpression(null, [t.identifier('module'), t.identifier('exports')], block);
|
281
|
+
var call = t.callExpression(t.identifier('__commoner_initialize_module__'), [f]);
|
282
|
+
var declarator = t.variableDeclarator(t.identifier(identifier), call);
|
283
|
+
var declaration = t.variableDeclaration('var', [declarator]);
|
284
|
+
|
285
|
+
node.body = [declaration];
|
280
286
|
node.directives = [];
|
287
|
+
|
288
|
+
// Rewrite calls
|
281
289
|
path.traverse(callRewriter, state);
|
290
|
+
|
291
|
+
if (block.body.length === 0) {
|
292
|
+
declarator.init = t.objectExpression([]);
|
293
|
+
}
|
282
294
|
}
|
283
295
|
}
|
284
296
|
}
|